ultimix
jquery.tree.metadata.js
Go to the documentation of this file.
1 (function ($) {
2  if(typeof $.metadata == "undefined") throw "jsTree metadata: jQuery metadata plugin not included.";
3 
4  $.extend($.tree.plugins, {
5  "metadata" : {
6  defaults : {
7  attribute : "data"
8  },
9  callbacks : {
10  check : function(rule, obj, value, tree) {
11  var opts = $.extend(true, {}, $.tree.plugins.metadata.defaults, this.settings.plugins.metadata);
12  if(typeof $(obj).metadata({ type : "attr", name : opts.attribute })[rule] != "undefined") return $(obj).metadata()[rule];
13  }
14  }
15  }
16  });
17 })(jQuery);