mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 17:14:07 +02:00
JS: Use arrow functions
All function () {} left in the code reference `this` and thus couldn't use arrow functions.
This commit is contained in:
@@ -76,7 +76,7 @@ for (const el of qsa('textarea')) {
|
||||
}
|
||||
});
|
||||
cm.setSize(width, height);
|
||||
cm.on('inputRead', function () {
|
||||
cm.on('inputRead', () => {
|
||||
const token = cm.getTokenAt(cm.getCursor());
|
||||
if (/^[.`"\w]\w*$/.test(token.string)) {
|
||||
CodeMirror.commands.autocomplete(cm);
|
||||
|
@@ -34,7 +34,7 @@ class AdminerEditCalendar {
|
||||
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
|
||||
if ($lang != "en" && file_exists(sprintf($this->langPath, $lang))) {
|
||||
echo Adminer\script_src(sprintf($this->langPath, $lang));
|
||||
echo Adminer\script("jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });");
|
||||
echo Adminer\script("jQuery(() => { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ function tablesFilterInput() {
|
||||
tablesFilterTimeout = window.setTimeout(tablesFilter, 200);
|
||||
}
|
||||
|
||||
sessionStorage && document.addEventListener('DOMContentLoaded', function () {
|
||||
sessionStorage && document.addEventListener('DOMContentLoaded', () => {
|
||||
let db = qs('#dbs').querySelector('select');
|
||||
db = db.options[db.selectedIndex].text;
|
||||
if (db == sessionStorage.getItem('adminer_tables_filter_db') && sessionStorage.getItem('adminer_tables_filter')){
|
||||
|
@@ -61,8 +61,8 @@ tinyMCE.init({
|
||||
return "<textarea$attrs id='fields-" . Adminer\h($field["field"]) . "' rows='12' cols='50'>" . Adminer\h($value) . "</textarea>" . Adminer\script("
|
||||
tinyMCE.remove(tinyMCE.get('fields-" . Adminer\js_escape($field["field"]) . "') || { });
|
||||
tinyMCE.EditorManager.execCommand('mceAddControl', true, 'fields-" . Adminer\js_escape($field["field"]) . "');
|
||||
qs('#form').onsubmit = function () {
|
||||
tinyMCE.each(tinyMCE.editors, function (ed) {
|
||||
qs('#form').onsubmit = () => {
|
||||
tinyMCE.each(tinyMCE.editors, ed => {
|
||||
ed.remove();
|
||||
});
|
||||
};
|
||||
|
@@ -9,6 +9,6 @@
|
||||
class AdminerVersionNoverify {
|
||||
|
||||
function head($dark = null) {
|
||||
echo Adminer\script("verifyVersion = function () {};");
|
||||
echo Adminer\script("verifyVersion = () => { };");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user