Skip to content

Commit 5bf17f1

Browse files
authored
Update simpleDialog.js
Bugs in success callback fixed
1 parent 20e2484 commit 5bf17f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

simpleDialog.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ $.simpleDialog = function (options) {
8686
event.preventDefault();
8787
if (typeof options.onSuccess === 'function' && options.onSuccess) {
8888
var data = options.onSuccess();
89-
if (data) {
90-
$('#simple-dialog-modal-' + currentID).modal('hide');
91-
}
89+
setTimeout(function () {
90+
if (data || data === undefined) {
91+
$('#simple-dialog-modal-' + currentID).modal('hide');
92+
}
93+
}, 0);
9294
} else {
9395
$('#simple-dialog-modal-' + currentID).modal('hide');
9496
}

0 commit comments

Comments
 (0)