diff options
-rw-r--r-- | js/src/main.js | 3 | ||||
-rw-r--r-- | js/src/page_settings.js | 10 | ||||
-rw-r--r-- | libraries/classes/Header.php | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/js/src/main.js b/js/src/main.js index 3779902868..c199a67fc7 100644 --- a/js/src/main.js +++ b/js/src/main.js @@ -35,3 +35,6 @@ window.AJAX.registerTeardown('indexes.js', Indexes.off()); window.AJAX.registerOnload('indexes.js', Indexes.on()); $(() => Functions.checkNumberOfFields()); + +window.AJAX.registerTeardown('page_settings.js', window.PageSettings.off()); +window.AJAX.registerOnload('page_settings.js', window.PageSettings.on()); diff --git a/js/src/page_settings.js b/js/src/page_settings.js index d65eb2eb4e..0b6a0239b1 100644 --- a/js/src/page_settings.js +++ b/js/src/page_settings.js @@ -33,16 +33,18 @@ function showNaviSettings () { showSettings('#pma_navigation_settings'); } -window.AJAX.registerTeardown('page_settings.js', function () { +window.PageSettings = {}; + +window.PageSettings.off = () => function () { $('#page_settings_icon').css('display', 'none'); $('#page_settings_icon').off('click'); $('#pma_navigation_settings_icon').off('click'); -}); +}; -window.AJAX.registerOnload('page_settings.js', function () { +window.PageSettings.on = () => function () { if ($('#page_settings_modal').length) { $('#page_settings_icon').css('display', 'inline'); $('#page_settings_icon').on('click', showPageSettings); } $('#pma_navigation_settings_icon').on('click', showNaviSettings); -}); +}; diff --git a/libraries/classes/Header.php b/libraries/classes/Header.php index 6c333cfbba..327b615a59 100644 --- a/libraries/classes/Header.php +++ b/libraries/classes/Header.php @@ -148,8 +148,8 @@ class Header $this->scripts->addFile('navigation.js'); $this->scripts->addFile('indexes.js'); $this->scripts->addFile('common.js'); - $this->scripts->addFile('main.js'); $this->scripts->addFile('page_settings.js'); + $this->scripts->addFile('main.js'); $this->scripts->addCode($this->getJsParamsCode()); } |