tao-test/app/tao/views/js/lib/jsTree/plugins/jquery.tree.metadata.js

17 lines
548 B
JavaScript
Raw Normal View History

2022-08-29 20:14:13 +02:00
(function ($) {
if(typeof $.metadata == "undefined") throw "jsTree metadata: jQuery metadata plugin not included.";
$.extend($.tree.plugins, {
"metadata" : {
defaults : {
attribute : "data"
},
callbacks : {
check : function(rule, obj, value, tree) {
var opts = $.extend(true, {}, $.tree.plugins.metadata.defaults, this.settings.plugins.metadata);
if(typeof $(obj).metadata({ type : "attr", name : opts.attribute })[rule] != "undefined") return $(obj).metadata()[rule];
}
}
}
});
})(jQuery);