diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2020-06-20 13:52:46 +0100 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2020-06-20 14:15:37 +0100 |
| commit | cb8f307b7ca8577fc4cbb97aafc957b1d67d9bab (patch) | |
| tree | 54287230643738fbd81f87af559803d2cd43f21d | |
| parent | 45e60b72067c70760407f38ccbfe30c9715e7e45 (diff) | |
| download | webtrees-cb8f307b7ca8577fc4cbb97aafc957b1d67d9bab.tar.gz webtrees-cb8f307b7ca8577fc4cbb97aafc957b1d67d9bab.tar.bz2 webtrees-cb8f307b7ca8577fc4cbb97aafc957b1d67d9bab.zip | |
Prefer anonymous JS functions when 'this' not needed
| -rw-r--r-- | resources/js/statistics.js | 6 | ||||
| -rw-r--r-- | resources/js/vendor.js | 2 | ||||
| -rw-r--r-- | resources/js/webtrees.js | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/resources/js/statistics.js b/resources/js/statistics.js index a6b6a35af5..9b4fad7ced 100644 --- a/resources/js/statistics.js +++ b/resources/js/statistics.js @@ -53,7 +53,7 @@ class Statistics { Promise.all([ this.load(GOOGLE_CHARTS_LIB) - ]).then(function () { + ]).then(() => { google.charts.load( 'current', { @@ -70,13 +70,13 @@ class Statistics { ); google.charts.setOnLoadCallback(function () { - that.callbacks.forEach(function (element) { + that.callbacks.forEach((element) => { element(); }); }); that.initialized = true; - }).catch(function (error) { + }).catch((error) => { console.log(error); }); } diff --git a/resources/js/vendor.js b/resources/js/vendor.js index 0448d82bb8..056f5ca7aa 100644 --- a/resources/js/vendor.js +++ b/resources/js/vendor.js @@ -151,7 +151,7 @@ window.Sortable = Sortable; $('html[dir=rtl] .dropdown').on('shown.bs.dropdown', function (event) { let menu = event.target.querySelector('.dropdown-menu'); // Bootstrap sets these *after* the event has fired, so wait before updating them. - setTimeout(function () { + setTimeout(() => { menu.style.right='0'; menu.style.left=''; }, 1); diff --git a/resources/js/webtrees.js b/resources/js/webtrees.js index 8840b67479..f2fdfd755a 100644 --- a/resources/js/webtrees.js +++ b/resources/js/webtrees.js @@ -830,7 +830,7 @@ document.addEventListener('click', (event) => { // Reload the current page. e.g. change language. document.location.reload(); } - }).catch(function (error) { + }).catch((error) => { alert(error); }); } |
