Skip to content

Commit 20e2484

Browse files
authored
Bugs in modal callbacks fixed
Small bugs in modal onSuccess callback
1 parent 22a8363 commit 20e2484

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

simpleDialog.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,15 @@ $.simpleDialog = function (options) {
8484
*/
8585
$(document).on('click', "#confirm-btn", function (event) {
8686
event.preventDefault();
87-
$('#simple-dialog-modal-' + currentID).modal('hide');
88-
if (typeof options.onSuccess === 'function' && options.onSuccess()) {
89-
options.onSuccess();
87+
if (typeof options.onSuccess === 'function' && options.onSuccess) {
88+
var data = options.onSuccess();
89+
if (data) {
90+
$('#simple-dialog-modal-' + currentID).modal('hide');
91+
}
92+
} else {
93+
$('#simple-dialog-modal-' + currentID).modal('hide');
9094
}
9195
});
92-
9396
/**
9497
* Handling close button events
9598
*/

0 commit comments

Comments
 (0)