1 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 * @fileoverview function used for page-related settings
4 * @name Page-related settings
8 * @required js/functions.js
11 function showSettings (selector) {
13 buttons[PMA_messages.strApply] = function () {
14 $('.config-form').submit();
17 buttons[PMA_messages.strCancel] = function () {
18 $(this).dialog('close');
21 // Keeping a clone to restore in case the user cancels the operation
22 var $clone = $(selector + ' .page_settings').clone(true);
25 title: PMA_messages.strPageSettings,
30 $(this).dialog('option', 'maxHeight', $(window).height() - $(this).offset().top);
33 $(selector + ' .page_settings').replaceWith($clone);
39 function showPageSettings () {
40 showSettings('#page_settings_modal');
43 function showNaviSettings () {
44 showSettings('#pma_navigation_settings');
47 AJAX.registerTeardown('page_settings.js', function () {
48 $('#page_settings_icon').css('display', 'none');
49 $('#page_settings_icon').off('click');
50 $('#pma_navigation_settings_icon').off('click');
53 AJAX.registerOnload('page_settings.js', function () {
54 if ($('#page_settings_modal').length) {
55 $('#page_settings_icon').css('display', 'inline');
56 $('#page_settings_icon').on('click', showPageSettings);
58 $('#pma_navigation_settings_icon').on('click', showNaviSettings);