annotate inkscape/firefox/content/themes/checkbox/change.js @ 604:38514a7c6b26 openvg

Linear gradient for OpenVG
author Thinker K.F. Li <thinker@branda.to>
date Sun, 04 Jul 2010 15:36:40 +0800
parents 4350aa369149
children
rev   line source
352
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
1 onchange : function (NODE, TREE_OBJ) {
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
2 var $this = $(NODE).is("li") ? $(NODE) : $(NODE).parent();
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
3 if($this.children("a.unchecked").size() == 0) {
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
4 TREE_OBJ.container.find("a").addClass("unchecked");
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
5 }
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
6 $this.children("a").removeClass("clicked");
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
7 if($this.children("a").hasClass("checked")) {
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
8 $this.find("li").andSelf().children("a").removeClass("checked").removeClass("undetermined").addClass("unchecked");
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
9 var state = 0;
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
10 }
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
11 else {
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
12 $this.find("li").andSelf().children("a").removeClass("unchecked").removeClass("undetermined").addClass("checked");
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
13 var state = 1;
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
14 }
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
15 $this.parents("li").each(function () {
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
16 if(state == 1) {
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
17 if($(this).find("a.unchecked, a.undetermined").size() - 1 > 0) {
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
18 $(this).parents("li").andSelf().children("a").removeClass("unchecked").removeClass("checked").addClass("undetermined");
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
19 return false;
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
20 }
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
21 else $(this).children("a").removeClass("unchecked").removeClass("undetermined").addClass("checked");
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
22 }
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
23 else {
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
24 if($(this).find("a.checked, a.undetermined").size() - 1 > 0) {
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
25 $(this).parents("li").andSelf().children("a").removeClass("unchecked").removeClass("checked").addClass("undetermined");
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
26 return false;
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
27 }
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
28 else $(this).children("a").removeClass("checked").removeClass("undetermined").addClass("unchecked");
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
29 }
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
30 });
4350aa369149 Use jQuery UI components.
wycc
parents:
diff changeset
31 }