Index: trunk/extensions/Vector/modules/ext.vector.collapsibleTabs.js |
— | — | @@ -7,8 +7,19 @@ |
8 | 8 | // Overloading the moveToCollapsed function to animate the transition |
9 | 9 | $.collapsibleTabs.moveToCollapsed = function( ele ) { |
10 | 10 | 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 |
12 | 14 | 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 | + |
13 | 24 | // Remove the element from where it's at and put it in the dropdown menu |
14 | 25 | var target = data.collapsedContainer; |
15 | 26 | $moving.css( "position", "relative" ) |
— | — | @@ -19,8 +30,18 @@ |
20 | 31 | $( '<span class="placeholder" style="display:none;"></span>' ).insertAfter( this ); |
21 | 32 | $( this ).remove().prependTo( target ).data( 'collapsibleTabsSettings', data ); |
22 | 33 | $( 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; |
25 | 46 | $.collapsibleTabs.handleResize(); |
26 | 47 | } ); |
27 | 48 | }; |
— | — | @@ -28,8 +49,18 @@ |
29 | 50 | // Overloading the moveToExpanded function to animate the transition |
30 | 51 | $.collapsibleTabs.moveToExpanded = function( ele ) { |
31 | 52 | 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 |
33 | 55 | 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 | + |
34 | 65 | // grab the next appearing placeholder so we can use it for replacing |
35 | 66 | var $target = $( data.expandedContainer ).find( 'span.placeholder:first' ); |
36 | 67 | var expandedWidth = data.expandedWidth; |
— | — | @@ -37,8 +68,18 @@ |
38 | 69 | $target.replaceWith( $moving.remove().css( 'width', '1px' ).data( 'collapsibleTabsSettings', data ) |
39 | 70 | .animate( { width: expandedWidth+"px" }, "normal", function() { |
40 | 71 | $( 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; |
43 | 84 | $.collapsibleTabs.handleResize(); |
44 | 85 | } ) ); |
45 | 86 | }; |
Property changes on: trunk/extensions/Vector/modules/ext.vector.collapsibleTabs.js |
___________________________________________________________________ |
Added: svn:mergeinfo |
46 | 87 | Merged /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Modules/CollapsibleTabs/CollapsibleTabs.js:r76468-76475 |