1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
(function ($) {
|
8
|
'use strict';
|
9
|
|
10
|
Drupal.behaviors.PanelizerIPE = {
|
11
|
attach: function (context) {
|
12
|
|
13
|
if ($(context).is('form#panels-ipe-edit-control-form.panels-ipe-edit-control-form')) {
|
14
|
window.onbeforeunload = null;
|
15
|
window.onunload = null;
|
16
|
}
|
17
|
|
18
|
|
19
|
$('input#panelizer-save-default', context).once('save-default-alert', function() {
|
20
|
$(this).bind('mouseup', function (e) {
|
21
|
if (!confirm(Drupal.t("This will save this configuration as the new default for all entities of this type. This action cannot be undone. Are you sure?"))) {
|
22
|
this.ipeCancelThis = true;
|
23
|
return false;
|
24
|
}
|
25
|
});
|
26
|
});
|
27
|
|
28
|
|
29
|
$('input#panelizer-ipe-revert', context).once('revert-alert', function() {
|
30
|
$(this).bind('mouseup', function (e) {
|
31
|
window.location.href = Drupal.settings.panelizer.revert_default_url;
|
32
|
this.ipeCancelThis = true;
|
33
|
return false;
|
34
|
});
|
35
|
});
|
36
|
}
|
37
|
};
|
38
|
|
39
|
})(jQuery);
|