mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Fixed page exit confirmation
This commit is contained in:
@ -3,17 +3,24 @@ var App = App || {};
|
||||
App.Util = function(_, jQuery, promise) {
|
||||
|
||||
var templateCache = {};
|
||||
var exitConfirmationEnabled = false;
|
||||
|
||||
function enableExitConfirmation() {
|
||||
exitConfirmationEnabled = true;
|
||||
jQuery(window).bind('beforeunload', function(e) {
|
||||
return 'There are unsaved changes.';
|
||||
});
|
||||
}
|
||||
|
||||
function disableExitConfirmation() {
|
||||
exitConfirmationEnabled = false;
|
||||
jQuery(window).unbind('beforeunload');
|
||||
}
|
||||
|
||||
function isExitConfirmationEnabled() {
|
||||
return exitConfirmationEnabled;
|
||||
}
|
||||
|
||||
function parseComplexRouteArgs(args) {
|
||||
var result = {};
|
||||
args = (args || '').split(/;/);
|
||||
@ -148,6 +155,7 @@ App.Util = function(_, jQuery, promise) {
|
||||
formatRelativeTime: formatRelativeTime,
|
||||
enableExitConfirmation: enableExitConfirmation,
|
||||
disableExitConfirmation: disableExitConfirmation,
|
||||
isExitConfirmationEnabled: isExitConfirmationEnabled,
|
||||
};
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user