Skip to content

Commit

Permalink
Add data Filter. Closes nyroDev#29
Browse files Browse the repository at this point in the history
Add $.nmData function. Closes nyroDev#29
  • Loading branch information
nyroDev committed Feb 14, 2011
1 parent fc10b79 commit 1048e26
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
29 changes: 29 additions & 0 deletions js/jquery.nyroModal.filters.data.js
@@ -0,0 +1,29 @@
/*
* nyroModal v2.0.0
*
* Data filter
*
* Depends:
* - filters.link
*
* Before: filters.dom
*/
jQuery(function($, undefined) {
$.nmFilters({
data: {
is: function(nm) {
var ret = nm.data ? true : false;
if (ret) {
nm._delFilter('dom');
}
return ret;
},
init: function(nm) {
nm.loadFilter = 'data';
},
load: function(nm) {
nm._setCont(nm.data);
}
}
});
});
2 changes: 1 addition & 1 deletion js/jquery.nyroModal.filters.image.js
Expand Up @@ -6,7 +6,7 @@
* Depends:
* - filters.link
*
* Before: filters.dom
* Before: filters.data
*/
jQuery(function($, undefined) {
$.nmFilters({
Expand Down
4 changes: 4 additions & 0 deletions js/jquery.nyroModal.js
Expand Up @@ -532,6 +532,9 @@ jQuery(function($, undefined) {
href: url
}).nyroModal(opts).trigger('nyroModal');
},
nmData: function(data, opts) {
this.nmManual('#', $.extend({data: data}, opts));
},
nmObj: function(opts) {
$.extend(true, _nmObj, opts);
},
Expand Down Expand Up @@ -815,6 +818,7 @@ jQuery(function($, undefined) {
// Add global jQuery functions
$.extend({
nmManual: _internal.nmManual,
nmData: _internal.nmData,
nmObj: _internal.nmObj,
nmInternal: _internal.nmInternal,
nmAnims: _internal.nmAnims,
Expand Down

0 comments on commit 1048e26

Please sign in to comment.