-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathjquery.tree.themeroller.js
More file actions
33 lines (32 loc) · 1.5 KB
/
jquery.tree.themeroller.js
File metadata and controls
33 lines (32 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(function ($) {
$.extend($.tree.plugins, {
"themeroller" : {
defaults : {
},
callbacks : {
oninit : function (t) {
if(this.settings.ui.theme_name != "themeroller") return;
var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller);
this.container.addClass("ui-widget ui-widget-content");
$(document).on("mouseover", "#" + this.container.attr("id") + " li a", function () { $(this).addClass("ui-state-hover"); });
$(document).on("mouseout", "#" + this.container.attr("id") + " li a", function () { $(this).removeClass("ui-state-hover"); });
},
onparse : function (s, t) {
if(this.settings.ui.theme_name != "themeroller") return;
var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller);
return $(s).find("a").not(".ui-state-default").addClass("ui-state-default").children("ins").addClass("ui-icon").end().end().end();
},
onselect : function(n, t) {
if(this.settings.ui.theme_name != "themeroller") return;
var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller);
$(n).children("a").addClass("ui-state-active");
},
ondeselect : function(n, t) {
if(this.settings.ui.theme_name != "themeroller") return;
var opts = $.extend(true, {}, $.tree.plugins.themeroller.defaults, this.settings.plugins.themeroller);
$(n).children("a").removeClass("ui-state-active");
}
}
}
});
})(jQuery);