From f14643725d2fbde70c3829e8e5fcc5c184e37bca Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sat, 18 Dec 2021 21:14:10 +0100 Subject: [PATCH] Converted normal functions to arrow functions --- assets/js/pages/account.js | 4 ++-- assets/js/pages/general_settings.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/js/pages/account.js b/assets/js/pages/account.js index c188011e..3baf18d8 100644 --- a/assets/js/pages/account.js +++ b/assets/js/pages/account.js @@ -48,7 +48,7 @@ App.Pages.Account = (function () { let missingRequiredFields = false; - $('#account .required').each(function (index, requiredField) { + $('#account .required').each((index, requiredField) => { const $requiredField = $(requiredField); if (!$requiredField.val()) { @@ -154,7 +154,7 @@ App.Pages.Account = (function () { const account = serialize(); - App.Http.Account.save(account).done(function () { + App.Http.Account.save(account).done(() => { Backend.displayNotification(App.Lang.settings_saved); $footerUserDisplayName.text('Hello, ' + $firstName.val() + ' ' + $lastName.val() + '!'); diff --git a/assets/js/pages/general_settings.js b/assets/js/pages/general_settings.js index 3a29c5c3..ea5b3e2a 100644 --- a/assets/js/pages/general_settings.js +++ b/assets/js/pages/general_settings.js @@ -30,7 +30,7 @@ App.Pages.GeneralSettings = (function () { let missingRequiredFields = false; - $('#general-settings .required').each(function (index, requiredField) { + $('#general-settings .required').each((index, requiredField) => { const $requiredField = $(requiredField); if (!$requiredField.val()) { @@ -51,7 +51,7 @@ App.Pages.GeneralSettings = (function () { } function serialize(generalSettings) { - generalSettings.forEach(function (generalSetting) { + generalSettings.forEach((generalSetting) => { $('[data-field="' + generalSetting.name + '"]').val(generalSetting.value); }); } @@ -59,7 +59,7 @@ App.Pages.GeneralSettings = (function () { function deserialize() { const generalSettings = []; - $('[data-field]').each(function (index, field) { + $('[data-field]').each((index, field) => { const $field = $(field); generalSettings.push({ @@ -83,7 +83,7 @@ App.Pages.GeneralSettings = (function () { const generalSettings = deserialize(); - App.Http.GeneralSettings.save(generalSettings).done(function () { + App.Http.GeneralSettings.save(generalSettings).done(() => { Backend.displayNotification(App.Lang.settings_saved); }); }