blob: d65eb2eb4e16eb2b477288af89a273e3c131056c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/**
* @fileoverview function used for page-related settings
* @name Page-related settings
*
* @requires jQuery
* @requires jQueryUI
* @required js/functions.js
*/
function showSettings (selector) {
// Keeping a clone to restore in case the user cancels the operation
var $clone = $(selector + ' .page_settings').clone(true);
$('#pageSettingsModalApplyButton').on('click', function () {
$('.config-form').trigger('submit');
});
$('#pageSettingsModalCloseButton,#pageSettingsModalCancelButton').on('click', function () {
$(selector + ' .page_settings').replaceWith($clone);
$('#pageSettingsModal').modal('hide');
});
$('#pageSettingsModal').modal('show');
$('#pageSettingsModal').find('.modal-body').first().html($(selector));
$(selector).css('display', 'block');
}
function showPageSettings () {
showSettings('#page_settings_modal');
}
function showNaviSettings () {
showSettings('#pma_navigation_settings');
}
window.AJAX.registerTeardown('page_settings.js', 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 () {
if ($('#page_settings_modal').length) {
$('#page_settings_icon').css('display', 'inline');
$('#page_settings_icon').on('click', showPageSettings);
}
$('#pma_navigation_settings_icon').on('click', showNaviSettings);
});
|