r113134 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113133‎ | r113134 | r113135 >
Date:13:43, 6 March 2012
Author:nad
Status:deferred
Tags:
Comment:
root node icon not updating, and img src was being set on every iteration of the animation
Modified paths:
  • /trunk/extensions/TreeAndMenu/star.js (modified) (history)

Diff [purge]

Index: trunk/extensions/TreeAndMenu/star.js
@@ -7,8 +7,8 @@
88 easing: 'swing',
99 out_spin: 2,
1010 in_spin: 2,
11 - width: '400px',
12 - height: '400px'
 11+ width: '500px',
 12+ height: '500px'
1313 }
1414
1515 /**
@@ -113,20 +113,22 @@
114114
115115 // If closing, change icon to "plus", flip t, and hide items at end
116116 if( data.open ) {
117 - $('img', e).attr('src', window.tamBaseUrl + window.star_config.img_node);
 117+ if( fx.pos == 0 ) $('img', e).attr('src', window.tamBaseUrl + window.star_config.img_node);
118118 if( t > 0.9 ) display = 'none';
119119 o = window.star_config.out_spin + t * window.star_config.in_spin;
120120 t = 1 - t;
121121 }
122122
123123 // If opening, change icon to "minus" and check siblings to see if one needs to be closed
124 - else if( d > 1 && fx.pos == 0 ) {
 124+ else if( fx.pos == 0 ) {
125125 $('img', e).attr('src', window.tamBaseUrl + window.star_config.img_open);
126 - var pdata = getData(data.parent);
127 - for( var i in pdata.children ) {
128 - var sibling = pdata.children[i];
129 - var sdata = getData(sibling);
130 - if( sdata.open ) animateNode(sibling);
 126+ if( d > 1 ) {
 127+ var pdata = getData(data.parent);
 128+ for( var i in pdata.children ) {
 129+ var sibling = pdata.children[i];
 130+ var sdata = getData(sibling);
 131+ if( sdata.open ) animateNode(sibling);
 132+ }
131133 }
132134 }
133135

Status & tagging log