Index: trunk/extensions/TreeAndMenu/star.js |
— | — | @@ -100,6 +100,7 @@ |
101 | 101 | var data = getData(e); |
102 | 102 | var display = 'block'; |
103 | 103 | var o = t * window.star_config.out_spin; |
| 104 | + var d = data.depth; |
104 | 105 | |
105 | 106 | // Set origin for the children to this elements center |
106 | 107 | var ox = e.position().left + e.width() / 2; |
— | — | @@ -115,8 +116,17 @@ |
116 | 117 | t = 1 - t; |
117 | 118 | } |
118 | 119 | |
| 120 | + // If opening, check siblings to see if one needs to be closed |
| 121 | + else if( d > 1 && fx.pos == 0 ) { |
| 122 | + var pdata = getData(data.parent); |
| 123 | + for( var i in pdata.children ) { |
| 124 | + var sibling = pdata.children[i]; |
| 125 | + var sdata = getData(sibling); |
| 126 | + if( sdata.open ) animateNode(sibling); |
| 127 | + } |
| 128 | + } |
| 129 | + |
119 | 130 | // Current radius for this elements children |
120 | | - var d = data.depth; |
121 | 131 | var r = window.star_config.radii; |
122 | 132 | r = d > r.length ? r[r.length-1] : r[d-1]; |
123 | 133 | r = r * t; |
Index: trunk/extensions/TreeAndMenu/TreeAndMenu.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | |
16 | 16 | if( !defined( 'MEDIAWIKI' ) ) die( 'Not an entry point.' ); |
17 | 17 | |
18 | | -define( 'TREEANDMENU_VERSION','2.0.2, 2012-02-08' ); |
| 18 | +define( 'TREEANDMENU_VERSION','2.0.3, 2012-02-15' ); |
19 | 19 | |
20 | 20 | // Set any unset images to default titles |
21 | 21 | if( !isset( $wgTreeViewImages ) || !is_array( $wgTreeViewImages ) ) $wgTreeViewImages = array(); |