comparison inkscape/firefox/content/themes/checkbox/change.js @ 352:4350aa369149

Use jQuery UI components.
author wycc
date Mon, 09 Mar 2009 01:27:33 +0800
parents
children
comparison
equal deleted inserted replaced
351:4ae9888bbde6 352:4350aa369149
1 onchange : function (NODE, TREE_OBJ) {
2 var $this = $(NODE).is("li") ? $(NODE) : $(NODE).parent();
3 if($this.children("a.unchecked").size() == 0) {
4 TREE_OBJ.container.find("a").addClass("unchecked");
5 }
6 $this.children("a").removeClass("clicked");
7 if($this.children("a").hasClass("checked")) {
8 $this.find("li").andSelf().children("a").removeClass("checked").removeClass("undetermined").addClass("unchecked");
9 var state = 0;
10 }
11 else {
12 $this.find("li").andSelf().children("a").removeClass("unchecked").removeClass("undetermined").addClass("checked");
13 var state = 1;
14 }
15 $this.parents("li").each(function () {
16 if(state == 1) {
17 if($(this).find("a.unchecked, a.undetermined").size() - 1 > 0) {
18 $(this).parents("li").andSelf().children("a").removeClass("unchecked").removeClass("checked").addClass("undetermined");
19 return false;
20 }
21 else $(this).children("a").removeClass("unchecked").removeClass("undetermined").addClass("checked");
22 }
23 else {
24 if($(this).find("a.checked, a.undetermined").size() - 1 > 0) {
25 $(this).parents("li").andSelf().children("a").removeClass("unchecked").removeClass("checked").addClass("undetermined");
26 return false;
27 }
28 else $(this).children("a").removeClass("checked").removeClass("undetermined").addClass("unchecked");
29 }
30 });
31 }