Browse Source

Do not show a warning for unsaved changes if no changes have been made.

pull/21656/head
SALİH ÖZKARA 1 year ago
parent
commit
57d3954bbe
  1. 10
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/jquery/jquery-extensions.js

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

@ -161,9 +161,17 @@
$.fn.needConfirmationOnUnsavedClose = function ($modal) {
var $form = $(this);
var formSaved = false;
var unEditedForm = JSON.stringify($form.serializeFormToObject());
var unEditedForm;
$modal.on("shown.bs.modal", function () {
unEditedForm = JSON.stringify($form.serializeFormToObject());
});
$modal.on("hide.bs.modal", function (e) {
if(unEditedForm === undefined) {
return;
}
var currentForm = JSON.stringify($form.serializeFormToObject());
var thereAreUnsavedChanges = currentForm !== unEditedForm;

Loading…
Cancel
Save