Skip to content

Commit d42cd1f

Browse files
committed
Add ability to stop closing action by return false in a close filter function. #fix 180
1 parent adce13c commit d42cd1f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

js/jquery.nyroModal.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,20 @@ jQuery(function($, undefined) {
237237
// Internal function for closing a nyroModal
238238
// Will call 'close' callback filter
239239
_close: function() {
240+
var ret = true;
240241
if (!this._animated) {
241242
this.getInternal()._removeStack(this.opener);
242243
this._opened = false;
243244
this._open = false;
244-
this._callFilters('close');
245-
return true;
245+
$.each(this._callFilters('close'), function(k, v) {
246+
if (v === false)
247+
ret = false;
248+
});
246249
} else {
247250
this._needClose = true;
251+
ret = false;
248252
}
249-
return false;
253+
return ret;
250254
},
251255
// Public function for closing a nyroModal
252256
close: function() {

0 commit comments

Comments
 (0)