r76628 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76627‎ | r76628 | r76629 >
Date:16:32, 13 November 2010
Author:catrope
Status:deferred
Tags:
Comment:
Merge live hacks from 1.16wmf4: r76467, r76469, r76471, r76474
Modified paths:
  • /trunk/extensions/Vector/modules/ext.vector.collapsibleTabs.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Vector/modules/ext.vector.collapsibleTabs.js
@@ -7,8 +7,19 @@
88 // Overloading the moveToCollapsed function to animate the transition
99 $.collapsibleTabs.moveToCollapsed = function( ele ) {
1010 var $moving = $( ele );
11 - $.collapsibleTabs.getSettings( $( $.collapsibleTabs.getSettings( $moving ).expandedContainer ) ).shifting = true;
 11+
 12+ //$.collapsibleTabs.getSettings( $( $.collapsibleTabs.getSettings( $moving ).expandedContainer ) ).shifting = true;
 13+ // Do the above, except with guards for JS errors
1214 var data = $.collapsibleTabs.getSettings( $moving );
 15+ if ( !data ) {
 16+ return;
 17+ }
 18+ var expContainerSettings = $.collapsibleTabs.getSettings( $( data.expandedContainer ) );
 19+ if ( !expContainerSettings ) {
 20+ return;
 21+ }
 22+ expContainerSettings.shifting = true;
 23+
1324 // Remove the element from where it's at and put it in the dropdown menu
1425 var target = data.collapsedContainer;
1526 $moving.css( "position", "relative" )
@@ -19,8 +30,18 @@
2031 $( '<span class="placeholder" style="display:none;"></span>' ).insertAfter( this );
2132 $( this ).remove().prependTo( target ).data( 'collapsibleTabsSettings', data );
2233 $( this ).attr( 'style', 'display:list-item;' );
23 - $.collapsibleTabs.getSettings( $( $.collapsibleTabs.getSettings( $( ele ) ).expandedContainer ) )
24 - .shifting = false;
 34+ //$.collapsibleTabs.getSettings( $( $.collapsibleTabs.getSettings( $( ele ) ).expandedContainer ) )
 35+ // .shifting = false;
 36+ // Do the above, except with guards for JS errors
 37+ var data = $.collapsibleTabs.getSettings( $( ele ) );
 38+ if ( !data ) {
 39+ return;
 40+ }
 41+ var expContainerSettings = $.collapsibleTabs.getSettings( $( data.expandedContainer ) );
 42+ if ( !expContainerSettings ) {
 43+ return;
 44+ }
 45+ expContainerSettings.shifting = false;
2546 $.collapsibleTabs.handleResize();
2647 } );
2748 };
@@ -28,8 +49,18 @@
2950 // Overloading the moveToExpanded function to animate the transition
3051 $.collapsibleTabs.moveToExpanded = function( ele ) {
3152 var $moving = $( ele );
32 - $.collapsibleTabs.getSettings( $( $.collapsibleTabs.getSettings( $moving ).expandedContainer ) ).shifting = true;
 53+ //$.collapsibleTabs.getSettings( $( $.collapsibleTabs.getSettings( $moving ).expandedContainer ) ).shifting = true;
 54+ // Do the above, except with guards for JS errors
3355 var data = $.collapsibleTabs.getSettings( $moving );
 56+ if ( !data ) {
 57+ return;
 58+ }
 59+ var expContainerSettings = $.collapsibleTabs.getSettings( $( data.expandedContainer ) );
 60+ if ( !expContainerSettings ) {
 61+ return;
 62+ }
 63+ expContainerSettings.shifting = true;
 64+
3465 // grab the next appearing placeholder so we can use it for replacing
3566 var $target = $( data.expandedContainer ).find( 'span.placeholder:first' );
3667 var expandedWidth = data.expandedWidth;
@@ -37,8 +68,18 @@
3869 $target.replaceWith( $moving.remove().css( 'width', '1px' ).data( 'collapsibleTabsSettings', data )
3970 .animate( { width: expandedWidth+"px" }, "normal", function() {
4071 $( this ).attr( 'style', 'display:block;' );
41 - $.collapsibleTabs.getSettings( $( $.collapsibleTabs.getSettings( $moving ).expandedContainer ) )
42 - .shifting = false;
 72+ //$.collapsibleTabs.getSettings( $( $.collapsibleTabs.getSettings( $( ele ) ).expandedContainer ) )
 73+ // .shifting = false;
 74+ // Do the above, except with guards for JS errors
 75+ var data = $.collapsibleTabs.getSettings( $( ele ) );
 76+ if ( !data ) {
 77+ return;
 78+ }
 79+ var expContainerSettings = $.collapsibleTabs.getSettings( $( data.expandedContainer ) );
 80+ if ( !expContainerSettings ) {
 81+ return;
 82+ }
 83+ expContainerSettings.shifting = false;
4384 $.collapsibleTabs.handleResize();
4485 } ) );
4586 };
Property changes on: trunk/extensions/Vector/modules/ext.vector.collapsibleTabs.js
___________________________________________________________________
Added: svn:mergeinfo
4687 Merged /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Modules/CollapsibleTabs/CollapsibleTabs.js:r76468-76475

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r764671.16wmf4: Live hack to try to shut up a JS error reported on IRCcatrope20:28, 10 November 2010
r76469Really do r76467, changing the right file this timecatrope20:41, 10 November 2010
r764711.16wmf4: More live hacking, hoping to really fix it this timecatrope21:11, 10 November 2010
r76474Fix parse error in r76471catrope21:23, 10 November 2010

Status & tagging log