2 * @fileoverview function used for page-related settings
3 * @name Page-related settings
7 * @required js/functions.js
10 function showSettings (selector) {
12 buttons[Messages.strApply] = function () {
13 $('.config-form').trigger('submit');
16 buttons[Messages.strCancel] = function () {
17 $(this).dialog('close');
20 // Keeping a clone to restore in case the user cancels the operation
21 var $clone = $(selector + ' .page_settings').clone(true);
24 title: Messages.strPageSettings,
29 $(this).dialog('option', 'maxHeight', $(window).height() - $(this).offset().top);
32 $(selector + ' .page_settings').replaceWith($clone);
38 function showPageSettings () {
39 showSettings('#page_settings_modal');
42 function showNaviSettings () {
43 showSettings('#pma_navigation_settings');
46 AJAX.registerTeardown('page_settings.js', function () {
47 $('#page_settings_icon').css('display', 'none');
48 $('#page_settings_icon').off('click');
49 $('#pma_navigation_settings_icon').off('click');
52 AJAX.registerOnload('page_settings.js', function () {
53 if ($('#page_settings_modal').length) {
54 $('#page_settings_icon').css('display', 'inline');
55 $('#page_settings_icon').on('click', showPageSettings);
57 $('#pma_navigation_settings_icon').on('click', showNaviSettings);