Skip to content

Commit 57d3954

Browse files
committed
Do not show a warning for unsaved changes if no changes have been made.
1 parent 1b8dbf0 commit 57d3954

File tree

1 file changed

+9
-1
lines changed
  • framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery

1 file changed

+9
-1
lines changed

framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,17 @@
161161
$.fn.needConfirmationOnUnsavedClose = function ($modal) {
162162
var $form = $(this);
163163
var formSaved = false;
164-
var unEditedForm = JSON.stringify($form.serializeFormToObject());
164+
var unEditedForm;
165+
166+
$modal.on("shown.bs.modal", function () {
167+
unEditedForm = JSON.stringify($form.serializeFormToObject());
168+
});
165169

166170
$modal.on("hide.bs.modal", function (e) {
171+
if(unEditedForm === undefined) {
172+
return;
173+
}
174+
167175
var currentForm = JSON.stringify($form.serializeFormToObject());
168176
var thereAreUnsavedChanges = currentForm !== unEditedForm;
169177

0 commit comments

Comments
 (0)