Index: trunk/extensions/TreeAndMenu/star.js |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | window.star_config = { |
3 | | - img_node: '/img/star-node-sml-gold.png', |
4 | | - img_leaf: '/img/star-node-sml.png', |
5 | | - img_disabled: '/img/star-node-sml-gold.png', |
| 3 | + img_node: '/img/star-node-plus.gif', |
| 4 | + img_leaf: '/img/star-node-empty.gif', |
| 5 | + img_open: '/img/star-node-minus.gif', |
6 | 6 | radii: [120,90,40,20], |
7 | 7 | duration: 500, |
8 | 8 | easing: 'swing', |
— | — | @@ -91,7 +91,9 @@ |
92 | 92 | |
93 | 93 | // Animate the passed node and its children from it's current state to the opposite state |
94 | 94 | function animateNode(node) { |
95 | | - $(node).animate( { t: 100 }, { |
| 95 | + var e = $(node); |
| 96 | + var data = getData(e); |
| 97 | + if( data.children.length > 0 ) e.animate( { t: 100 }, { |
96 | 98 | duration: window.star_config.duration, |
97 | 99 | easing: window.star_config.easing, |
98 | 100 | step: function(now, fx) { |
— | — | @@ -109,15 +111,17 @@ |
110 | 112 | // Hide the labels during animation |
111 | 113 | var col = t < 0.9 ? 'white' : 'black'; |
112 | 114 | |
113 | | - // If closing flip t, and hide items at end |
| 115 | + // If closing, change icon to "plus", flip t, and hide items at end |
114 | 116 | if( data.open ) { |
| 117 | + $('img', e).attr('src', window.tamBaseUrl + window.star_config.img_node); |
115 | 118 | if( t > 0.9 ) display = 'none'; |
116 | 119 | o = window.star_config.out_spin + t * window.star_config.in_spin; |
117 | 120 | t = 1 - t; |
118 | 121 | } |
119 | 122 | |
120 | | - // If opening, check siblings to see if one needs to be closed |
| 123 | + // If opening, change icon to "minus" and check siblings to see if one needs to be closed |
121 | 124 | else if( d > 1 && fx.pos == 0 ) { |
| 125 | + $('img', e).attr('src', window.tamBaseUrl + window.star_config.img_open); |
122 | 126 | var pdata = getData(data.parent); |
123 | 127 | for( var i in pdata.children ) { |
124 | 128 | var sibling = pdata.children[i]; |
Index: trunk/extensions/TreeAndMenu/img/star-node-sml-grn.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/extensions/TreeAndMenu/img/star-node-plus.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/TreeAndMenu/img/star-node-plus.gif |
___________________________________________________________________ |
Added: svn:mime-type |
125 | 129 | + application/octet-stream |
Index: trunk/extensions/TreeAndMenu/img/star-node-minus.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/TreeAndMenu/img/star-node-minus.gif |
___________________________________________________________________ |
Added: svn:mime-type |
126 | 130 | + application/octet-stream |
Index: trunk/extensions/TreeAndMenu/img/star-node-empty.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/TreeAndMenu/img/star-node-empty.gif |
___________________________________________________________________ |
Added: svn:mime-type |
127 | 131 | + application/octet-stream |