r113130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113129‎ | r113130 | r113131 >
Date:13:15, 6 March 2012
Author:nad
Status:deferred
Tags:
Comment:
use plus/minus icons for star menus
Modified paths:
  • /trunk/extensions/TreeAndMenu/img/star-node-empty.gif (added) (history)
  • /trunk/extensions/TreeAndMenu/img/star-node-minus.gif (added) (history)
  • /trunk/extensions/TreeAndMenu/img/star-node-plus.gif (added) (history)
  • /trunk/extensions/TreeAndMenu/img/star-node-sml-grn.png (deleted) (history)
  • /trunk/extensions/TreeAndMenu/star.js (modified) (history)

Diff [purge]

Index: trunk/extensions/TreeAndMenu/star.js
@@ -1,7 +1,7 @@
22 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',
66 radii: [120,90,40,20],
77 duration: 500,
88 easing: 'swing',
@@ -91,7 +91,9 @@
9292
9393 // Animate the passed node and its children from it's current state to the opposite state
9494 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 }, {
9698 duration: window.star_config.duration,
9799 easing: window.star_config.easing,
98100 step: function(now, fx) {
@@ -109,15 +111,17 @@
110112 // Hide the labels during animation
111113 var col = t < 0.9 ? 'white' : 'black';
112114
113 - // If closing flip t, and hide items at end
 115+ // If closing, change icon to "plus", flip t, and hide items at end
114116 if( data.open ) {
 117+ $('img', e).attr('src', window.tamBaseUrl + window.star_config.img_node);
115118 if( t > 0.9 ) display = 'none';
116119 o = window.star_config.out_spin + t * window.star_config.in_spin;
117120 t = 1 - t;
118121 }
119122
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
121124 else if( d > 1 && fx.pos == 0 ) {
 125+ $('img', e).attr('src', window.tamBaseUrl + window.star_config.img_open);
122126 var pdata = getData(data.parent);
123127 for( var i in pdata.children ) {
124128 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
125129 + 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
126130 + 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
127131 + application/octet-stream

Status & tagging log