r58969 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58968‎ | r58969 | r58970 >
Date:20:36, 12 November 2009
Author:adam
Status:ok (Comments)
Tags:
Comment:
Fixing a bug on collapsible tabs where the tabs would get stuck alternating between collapsed and expanded.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleTabs/CollapsibleTabs.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleTabs/CollapsibleTabs.js
@@ -52,10 +52,10 @@
5353 }).collapsibleTabs({
5454 expandCondition: function(eleWidth) {
5555 if( rtl ){
56 - return ( $j('#right-navigation').position().left + $j('#right-navigation').width())
 56+ return ( $j('#right-navigation').position().left + $j('#right-navigation').width() + 1)
5757 < ($j('#left-navigation').position().left - eleWidth);
5858 } else {
59 - return ( $j('#left-navigation').position().left + $j('#left-navigation').width())
 59+ return ( $j('#left-navigation').position().left + $j('#left-navigation').width() + 1)
6060 < ($j('#right-navigation').position().left - eleWidth);
6161 }
6262 },
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php
@@ -12,15 +12,15 @@
1313
1414 static $scripts = array(
1515 'raw' => array(
16 - array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 1 ),
 16+ array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 2 ),
1717 array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 1 ),
1818 array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 1 ),
1919 ),
2020 'combined' => array(
21 - array( 'src' => 'Vector.combined.js', 'version' => 1 ),
 21+ array( 'src' => 'Vector.combined.js', 'version' => 2 ),
2222 ),
2323 'minified' => array(
24 - array( 'src' => 'Vector.combined.min.js', 'version' => 1 ),
 24+ array( 'src' => 'Vector.combined.min.js', 'version' => 2 ),
2525 ),
2626 );
2727 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -52,10 +52,10 @@
5353 }).collapsibleTabs({
5454 expandCondition: function(eleWidth) {
5555 if( rtl ){
56 - return ( $j('#right-navigation').position().left + $j('#right-navigation').width())
 56+ return ( $j('#right-navigation').position().left + $j('#right-navigation').width() + 1)
5757 < ($j('#left-navigation').position().left - eleWidth);
5858 } else {
59 - return ( $j('#left-navigation').position().left + $j('#left-navigation').width())
 59+ return ( $j('#left-navigation').position().left + $j('#left-navigation').width() + 1)
6060 < ($j('#right-navigation').position().left - eleWidth);
6161 }
6262 },
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -1,7 +1,7 @@
22
33 js2AddOnloadHook(function(){var rtl=$j('body.rtl').size()?true:false;$j.collapsibleTabs.moveToCollapsed=function(ele){var $moving=$j(ele);$j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting=true;var data=$moving.data('collapsibleTabsSettings');var target=$moving.data('collapsibleTabsSettings').collapsedContainer;$moving.css("position","relative").css((rtl?'left':'right'),0);$moving.animate({width:'1px'},"normal",function(){$j(this).hide();$j('<span class="placeholder" style="display:none;"></span>').insertAfter(this);$j(this).remove().prependTo(target).data('collapsibleTabsSettings',data);$j(this).attr('style','display:list-item;');$j($j(ele).data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting=false;$j.collapsibleTabs.handleResize();});};$j.collapsibleTabs.moveToExpanded=function(ele){var $moving=$j(ele);$j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting=true;var data=$moving.data('collapsibleTabsSettings');var $target=$j($moving.data('collapsibleTabsSettings').expandedContainer).find('span.placeholder:first');var expandedWidth=$moving.data('collapsibleTabsSettings').expandedWidth;$moving.css("position","relative").css((rtl?'right':'left'),0).css('width','1px');$target.replaceWith($moving.remove().css('width','1px').data('collapsibleTabsSettings',data).animate({width:expandedWidth+"px"},"normal",function(){$j(this).attr('style','display:block;');$j($moving.data('collapsibleTabsSettings').expandedContainer).data('collapsibleTabsSettings').shifting=false;$j.collapsibleTabs.handleResize();}));};$j('#p-views ul').bind("beforeTabCollapse",function(){if($j('#p-cactions').css('display')=='none')
44 $j("#p-cactions").addClass("filledPortlet").removeClass("emptyPortlet").find('h5').css('width','1px').animate({'width':'26px'},390);}).bind("beforeTabExpand",function(){if($j('#p-cactions li').length==1)
5 -$j("#p-cactions h5").animate({'width':'1px'},370,function(){$j(this).attr('style','').parent().addClass("emptyPortlet").removeClass("filledPortlet");});}).collapsibleTabs({expandCondition:function(eleWidth){if(rtl){return($j('#right-navigation').position().left+$j('#right-navigation').width())<($j('#left-navigation').position().left-eleWidth);}else{return($j('#left-navigation').position().left+$j('#left-navigation').width())<($j('#right-navigation').position().left-eleWidth);}},collapseCondition:function(){if(rtl){return($j('#right-navigation').position().left+$j('#right-navigation').width())>$j('#left-navigation').position().left;}else{return($j('#left-navigation').position().left+$j('#left-navigation').width())>$j('#right-navigation').position().left;}}});});js2AddOnloadHook(function(){if(!wgVectorPreferences||!(wgVectorPreferences.editwarning&&wgVectorPreferences.editwarning.enable)){return true;}
 5+$j("#p-cactions h5").animate({'width':'1px'},370,function(){$j(this).attr('style','').parent().addClass("emptyPortlet").removeClass("filledPortlet");});}).collapsibleTabs({expandCondition:function(eleWidth){if(rtl){return($j('#right-navigation').position().left+$j('#right-navigation').width()+1)<($j('#left-navigation').position().left-eleWidth);}else{return($j('#left-navigation').position().left+$j('#left-navigation').width()+1)<($j('#right-navigation').position().left-eleWidth);}},collapseCondition:function(){if(rtl){return($j('#right-navigation').position().left+$j('#right-navigation').width())>$j('#left-navigation').position().left;}else{return($j('#left-navigation').position().left+$j('#left-navigation').width())>$j('#right-navigation').position().left;}}});});js2AddOnloadHook(function(){if(!wgVectorPreferences||!(wgVectorPreferences.editwarning&&wgVectorPreferences.editwarning.enable)){return true;}
66 $j('#wpTextbox1, #wpSummary').each(function(){$j(this).data('origtext',$j(this).val());});fallbackWindowOnBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){var fallbackResult=null;if(fallbackWindowOnBeforeUnload){fallbackResult=fallbackWindowOnBeforeUnload();}
77 if(fallbackResult!==null){return fallbackResult;}
88 if($j('#wpTextbox1').data('origtext')!=$j('#wpTextbox1').val()||$j('#wpSummary').data('origtext')!=$j('#wpSummary').val()||$j('#wikiPreview').is(':visible')){return gM('vector-editwarning-warning');}}

Follow-up revisions

RevisionCommit summaryAuthorDate
r58971usability: Merge r58969 (CollapsibleTabs bouncing fix) from trunk to acaifixcatrope20:41, 12 November 2009
r59204wmf-deployment: Merging usability changes from trunk...catrope18:53, 18 November 2009

Comments

#Comment by Shuhari (talk | contribs)   18:49, 18 November 2009

This revision was reviewed by Werdna at 6:44pm UTC on November 18th before production deployment.

Status & tagging log