mirror of
https://github.com/unraid/webgui.git
synced 2026-04-24 11:19:25 -05:00
Add event to form to confirm open changes
This commit is contained in:
@@ -688,11 +688,7 @@ $(function() {
|
||||
form.find('input[value="<?=_("Done")?>"],input[value="Done"]').not('input.lock').val("<?=_('Reset')?>").prop('onclick',null).off('click').click(function(){formHasUnsavedChanges=false;refresh(form.offset().top);});
|
||||
});});
|
||||
// add leave confirmation when form has changed without applying (opt-in function)
|
||||
$('form.js-confirm-leave').on('change',function(e){
|
||||
formHasUnsavedChanges=true;
|
||||
}).on('submit',function(e){
|
||||
formHasUnsavedChanges=false;
|
||||
});
|
||||
$('form.js-confirm-leave').on('change',function(e){formHasUnsavedChanges=true;}).on('submit',function(e){formHasUnsavedChanges=false;});
|
||||
$(window).on('beforeunload',function(e){if (formHasUnsavedChanges) return '';}); // note: the browser creates its own popup window and warning message
|
||||
|
||||
var top = ($.cookie('top')||0) - $('.tabs').offset().top - 75;
|
||||
|
||||
Reference in New Issue
Block a user