r57953 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57952‎ | r57953 | r57954 >
Date:19:34, 20 October 2009
Author:adam
Status:deferred
Tags:
Comment:
CollapsibleTabs: (bug 21203) Updating the custom expand and contract functions to properly call the resize handler and enable multiple tabs to be collapsed on one resize event
Modified paths:
  • /trunk/extensions/UsabilityInitiative/CollapsibleTabs/CollapsibleTabs.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/CollapsibleTabs/CollapsibleTabs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/CollapsibleTabs/CollapsibleTabs.php
@@ -13,7 +13,7 @@
1414 *
1515 * @author Adam Miller <amiller@wikimedia.org>
1616 * @license GPL v2 or later
17 - * @version 0.0.2
 17+ * @version 0.0.6
1818 */
1919
2020 /* Configuration */
@@ -27,7 +27,7 @@
2828 'path' => __FILE__,
2929 'name' => 'CollapsibleTabs',
3030 'author' => 'Adam Miller',
31 - 'version' => '0.0.5',
 31+ 'version' => '0.0.6',
3232 'url' => 'http://www.mediawiki.org/wiki/Extension:CollapsibleTabs',
3333 'descriptionmsg' => 'collapsibletabs-desc',
3434 );
Index: trunk/extensions/UsabilityInitiative/CollapsibleTabs/CollapsibleTabs.js
@@ -2,11 +2,11 @@
33
44 //Overloading the moveToCollapsed function to animate the transition
55 $j.collapsibleTabs.moveToCollapsed = function( ele ) {
6 - $moving = $j(ele);
 6+ var $moving = $j(ele);
77 $j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting = true;
8 - data = $moving.data('collapsibleTabsSettings');
 8+ var data = $moving.data('collapsibleTabsSettings');
99 // Remove the element from where it's at and put it in the dropdown menu
10 - target = $moving.data('collapsibleTabsSettings').collapsedContainer;
 10+ var target = $moving.data('collapsibleTabsSettings').collapsedContainer;
1111 // $moving.hide(500);
1212 $moving.css("position", "relative").css('right',0);
1313 $moving.animate({width: '1px'},"normal",function(){
@@ -15,23 +15,24 @@
1616 $j(this).remove().prependTo(target).data('collapsibleTabsSettings', data);
1717 $j(this).attr('style', '');
1818 $j($j(ele).data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting = false;
 19+ $j.collapsibleTabs.handleResize();
1920 });
2021 };
2122
2223 // Overloading the moveToExpanded function to animate the transition
2324 $j.collapsibleTabs.moveToExpanded = function( ele ) {
24 - $moving = $j(ele);
 25+ var $moving = $j(ele);
2526 $j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting = true;
26 - data = $moving.data('collapsibleTabsSettings');
 27+ var data = $moving.data('collapsibleTabsSettings');
2728 // remove this element from where it's at and put it in the dropdown menu
28 - target = $moving.data('collapsibleTabsSettings').prevElement;
29 - expandedWidth = $moving.data('collapsibleTabsSettings').expandedWidth;
 29+ var target = $moving.data('collapsibleTabsSettings').prevElement;
 30+ var expandedWidth = $moving.data('collapsibleTabsSettings').expandedWidth;
3031 $moving.css("position", "relative").css('left',0).css('width','1px');
3132 $moving.remove().css('width','1px').insertAfter(target).data('collapsibleTabsSettings', data)
3233 .animate({width: expandedWidth+"px"}, "normal", function(){
3334 $j(this).attr('style', '');
3435 $j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting = false;
35 -
 36+ $j.collapsibleTabs.handleResize();
3637 });
3738 };
3839

Follow-up revisions

RevisionCommit summaryAuthorDate
r57958CollapsibleTabs: Bump style version for r57953catrope20:18, 20 October 2009

Status & tagging log