r111601 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111600‎ | r111601 | r111602 >
Date:00:35, 16 February 2012
Author:nad
Status:deferred
Tags:
Comment:
close any open sibling star node when opening another
Modified paths:
  • /trunk/extensions/TreeAndMenu/TreeAndMenu.php (modified) (history)
  • /trunk/extensions/TreeAndMenu/star.js (modified) (history)

Diff [purge]

Index: trunk/extensions/TreeAndMenu/star.js
@@ -100,6 +100,7 @@
101101 var data = getData(e);
102102 var display = 'block';
103103 var o = t * window.star_config.out_spin;
 104+ var d = data.depth;
104105
105106 // Set origin for the children to this elements center
106107 var ox = e.position().left + e.width() / 2;
@@ -115,8 +116,17 @@
116117 t = 1 - t;
117118 }
118119
 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+
119130 // Current radius for this elements children
120 - var d = data.depth;
121131 var r = window.star_config.radii;
122132 r = d > r.length ? r[r.length-1] : r[d-1];
123133 r = r * t;
Index: trunk/extensions/TreeAndMenu/TreeAndMenu.php
@@ -14,7 +14,7 @@
1515
1616 if( !defined( 'MEDIAWIKI' ) ) die( 'Not an entry point.' );
1717
18 -define( 'TREEANDMENU_VERSION','2.0.2, 2012-02-08' );
 18+define( 'TREEANDMENU_VERSION','2.0.3, 2012-02-15' );
1919
2020 // Set any unset images to default titles
2121 if( !isset( $wgTreeViewImages ) || !is_array( $wgTreeViewImages ) ) $wgTreeViewImages = array();

Status & tagging log