Permalink
Browse files

Add ability to stop closing action by return false in a close filter …

…function. #fix 180
  • Loading branch information...
1 parent adce13c commit d42cd1f307e6fadab776a1ba319343baad845b7c @nyroDev committed Oct 16, 2014
Showing with 7 additions and 3 deletions.
  1. +7 −3 js/jquery.nyroModal.js
@@ -237,16 +237,20 @@ jQuery(function($, undefined) {
// Internal function for closing a nyroModal
// Will call 'close' callback filter
_close: function() {
+ var ret = true;
if (!this._animated) {
this.getInternal()._removeStack(this.opener);
this._opened = false;
this._open = false;
- this._callFilters('close');
- return true;
+ $.each(this._callFilters('close'), function(k, v) {
+ if (v === false)
+ ret = false;
+ });
} else {
this._needClose = true;
+ ret = false;
}
- return false;
+ return ret;
},
// Public function for closing a nyroModal
close: function() {

0 comments on commit d42cd1f

Please sign in to comment.