Browse Source
Merge pull request #21656 from abpframework/vs-issue-5593
Do not show a warning for unsaved changes if no changes have been made.
pull/21661/head
Gizem Mutu Kurt
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
9 additions and
1 deletions
-
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) { |
|
|
$.fn.needConfirmationOnUnsavedClose = function ($modal) { |
|
|
var $form = $(this); |
|
|
var $form = $(this); |
|
|
var formSaved = false; |
|
|
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) { |
|
|
$modal.on("hide.bs.modal", function (e) { |
|
|
|
|
|
if(unEditedForm === undefined) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var currentForm = JSON.stringify($form.serializeFormToObject()); |
|
|
var currentForm = JSON.stringify($form.serializeFormToObject()); |
|
|
var thereAreUnsavedChanges = currentForm !== unEditedForm; |
|
|
var thereAreUnsavedChanges = currentForm !== unEditedForm; |
|
|
|
|
|
|
|
|
|