Index: trunk/phase3/resources/jquery/jquery.collapsibleTabs.js |
— | — | @@ -49,12 +49,14 @@ |
50 | 50 | }, |
51 | 51 | addData: function( $collapsible ) { |
52 | 52 | var $settings = $collapsible.parent().data( 'collapsibleTabsSettings' ); |
53 | | - $collapsible.data( 'collapsibleTabsSettings', { |
54 | | - 'expandedContainer': $settings.expandedContainer, |
55 | | - 'collapsedContainer': $settings.collapsedContainer, |
56 | | - 'expandedWidth': $collapsible.width(), |
57 | | - 'prevElement': $collapsible.prev() |
58 | | - } ); |
| 53 | + if ( typeof $settings != 'undefined' ) { |
| 54 | + $collapsible.data( 'collapsibleTabsSettings', { |
| 55 | + 'expandedContainer': $settings.expandedContainer, |
| 56 | + 'collapsedContainer': $settings.collapsedContainer, |
| 57 | + 'expandedWidth': $collapsible.width(), |
| 58 | + 'prevElement': $collapsible.prev() |
| 59 | + } ); |
| 60 | + } |
59 | 61 | }, |
60 | 62 | getSettings: function( $collapsible ) { |
61 | 63 | var $settings = $collapsible.data( 'collapsibleTabsSettings' ); |
— | — | @@ -95,7 +97,7 @@ |
96 | 98 | var dataExp = $.collapsibleTabs.getSettings( data.expandedContainer ); |
97 | 99 | dataExp.shifting = true; |
98 | 100 | $moving |
99 | | - .remove() |
| 101 | + .detach() |
100 | 102 | .prependTo( data.collapsedContainer ) |
101 | 103 | .data( 'collapsibleTabsSettings', data ); |
102 | 104 | dataExp.shifting = false; |
— | — | @@ -107,7 +109,7 @@ |
108 | 110 | var dataExp = $.collapsibleTabs.getSettings( data.expandedContainer ); |
109 | 111 | dataExp.shifting = true; |
110 | 112 | // remove this element from where it's at and put it in the dropdown menu |
111 | | - $moving.remove().insertAfter( data.prevElement ).data( 'collapsibleTabsSettings', data ); |
| 113 | + $moving.detach().insertAfter( data.prevElement ).data( 'collapsibleTabsSettings', data ); |
112 | 114 | dataExp.shifting = false; |
113 | 115 | $.collapsibleTabs.handleResize(); |
114 | 116 | } |
Index: trunk/extensions/Vector/modules/ext.vector.collapsibleTabs.js |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | $( this ).hide(); |
30 | 30 | // add the placeholder |
31 | 31 | $( '<span class="placeholder" style="display:none;"></span>' ).insertAfter( this ); |
32 | | - $( this ).remove().prependTo( target ).data( 'collapsibleTabsSettings', data ); |
| 32 | + $( this ).detach().prependTo( target ).data( 'collapsibleTabsSettings', data ); |
33 | 33 | $( this ).attr( 'style', 'display:list-item;' ); |
34 | 34 | //$.collapsibleTabs.getSettings( $( $.collapsibleTabs.getSettings( $( ele ) ).expandedContainer ) ) |
35 | 35 | // .shifting = false; |
— | — | @@ -65,13 +65,13 @@ |
66 | 66 | var $target = $( data.expandedContainer ).find( 'span.placeholder:first' ); |
67 | 67 | var expandedWidth = data.expandedWidth; |
68 | 68 | $moving.css( "position", "relative" ).css( ( rtl ? 'right' : 'left' ), 0 ).css( 'width', '1px' ); |
69 | | - $target.replaceWith( $moving.remove().css( 'width', '1px' ).data( 'collapsibleTabsSettings', data ) |
70 | | - .animate( { width: expandedWidth+"px" }, "normal", function() { |
| 69 | + $target.replaceWith( $moving.detach().css( 'width', '1px' ).data( 'collapsibleTabsSettings', data ) |
| 70 | + .animate( { width: expandedWidth+"px" }, "normal", function( ) { |
71 | 71 | $( this ).attr( 'style', 'display:block;' ); |
72 | 72 | //$.collapsibleTabs.getSettings( $( $.collapsibleTabs.getSettings( $( ele ) ).expandedContainer ) ) |
73 | 73 | // .shifting = false; |
74 | 74 | // Do the above, except with guards for JS errors |
75 | | - var data = $.collapsibleTabs.getSettings( $( ele ) ); |
| 75 | + var data = $.collapsibleTabs.getSettings( $( this ) ); |
76 | 76 | if ( !data ) { |
77 | 77 | return; |
78 | 78 | } |