mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-24 05:42:10 +08:00
#18937: Adding a confirmation dialog when try to leave navigation with pending changes
Work Item: 18937 --HG-- branch : 1.x
This commit is contained in:
@@ -38,8 +38,19 @@
|
||||
// update all positions whenever a menu item was moved
|
||||
populate(this, '');
|
||||
$('#save-message').show();
|
||||
|
||||
// display a message on leave if changes have been made
|
||||
window.onbeforeunload = function (e) {
|
||||
return leaveConfirmation;
|
||||
};
|
||||
|
||||
// cancel leaving message on save
|
||||
$('#saveButton').click(function (e) {
|
||||
window.onbeforeunload = function () { };
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
})(jQuery);
|
||||
})(jQuery);
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
|
||||
<fieldset class="actions">
|
||||
<button type="submit" class="button">@T("Save All")</button>
|
||||
<button id="saveButton" type="submit" class="button">@T("Save All")</button>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
@@ -126,3 +126,11 @@
|
||||
}
|
||||
@:</ol>
|
||||
}
|
||||
|
||||
@using (Script.Foot()) {
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var leaveConfirmation = '@T("Some items where not saved.")';
|
||||
//]]>
|
||||
</script>
|
||||
}
|
||||
Reference in New Issue
Block a user