mirror of
https://github.com/vrana/adminer.git
synced 2025-08-13 01:54:00 +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:
@@ -25,7 +25,7 @@ function whisper(url) {
|
||||
const field = this;
|
||||
field.orig = field.value;
|
||||
field.previousSibling.value = field.value; // accept number, reject string
|
||||
return ajax(url + encodeURIComponent(field.value), function (xmlhttp) {
|
||||
return ajax(url + encodeURIComponent(field.value), xmlhttp => {
|
||||
if (xmlhttp.status && field.orig == field.value) { // ignore old responses
|
||||
field.nextSibling.innerHTML = xmlhttp.responseText;
|
||||
field.nextSibling.style.display = '';
|
||||
@@ -59,7 +59,7 @@ function whisperClick(event) {
|
||||
*/
|
||||
function emailFileChange() {
|
||||
const el = this.cloneNode(true);
|
||||
this.onchange = function () { };
|
||||
this.onchange = () => { };
|
||||
el.value = '';
|
||||
this.parentNode.appendChild(el);
|
||||
}
|
||||
|
Reference in New Issue
Block a user