Browse Source
Merge pull request #21661 from abpframework/auto-merge/rel-9-0/3307
Merge branch dev with rel-9.0
pull/21664/head
maliming
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) { |
|
|
|
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; |
|
|
|
|
|
|
|
|