Permalink
Browse files

Add nmDestroy function and all needed destroy function in filters fix #…

  • Loading branch information...
1 parent d5da144 commit 3a2e1f043a243e4cfea600c1994471742cc31ef8 @nyroDev committed Oct 21, 2012
@@ -44,6 +44,9 @@ jQuery(function($, undefined) {
});
$.ajax(ajax);
+ },
+ destroy: function(nm) {
+ nm.opener.off('submit.nyroModal');
}
}
});
@@ -103,6 +103,9 @@ jQuery(function($, undefined) {
nm.store.formFileIframe = undefined;
delete(nm.store.formFileIframe);
}
+ },
+ destroy: function(nm) {
+ nm.opener.off('submit.nyroModal')
}
}
});
@@ -56,6 +56,9 @@ jQuery(function($, undefined) {
nm.store.iframeFormIframe = undefined;
delete(nm.store.iframeFormIframe);
}
+ },
+ destroy: function(nm) {
+ nm.opener.off('submit.nyroModal')
}
}
});
@@ -35,6 +35,9 @@ jQuery(function($, undefined) {
}
});
$.ajax(ajax);
+ },
+ destroy: function(nm) {
+ nm.opener.off('click.nyroModal');
}
}
});
@@ -226,6 +226,16 @@ jQuery(function($, undefined) {
});
});
},
+
+ // Public function for destroying a nyroModal instance, only for non open modal
+ destroy: function() {
+ if (this._open)
+ return false;
+ this._callFilters('destroy');
+ if (this.elts.all)
+ this.elts.all.remove();
+ return true;
+ },
// Init HTML elements
_initElts: function() {
@@ -553,6 +563,15 @@ jQuery(function($, undefined) {
: $.extend(true, {opener: me}, _nmObj, opts));
});
},
+ nmDestroy: function() {
+ return this.each(function() {
+ var me = $(this);
+ if (me.data('nmObj')) {
+ if (me.data('nmObj').destroy())
+ me.removeData('nmObj');
+ }
+ });
+ },
nmCall: function() {
return this.trigger('nyroModal');
},
@@ -847,6 +866,7 @@ jQuery(function($, undefined) {
nm: _internal.nyroModal,
nyroModal: _internal.nyroModal,
nmInit: _internal.nmInit,
+ nmDestroy: _internal.nmDestroy,
nmCall: _internal.nmCall
});

0 comments on commit 3a2e1f0

Please sign in to comment.