Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Modules/CollapsibleTabs/CollapsibleTabs.js |
— | — | @@ -9,6 +9,9 @@ |
10 | 10 | // Overloading the moveToCollapsed function to animate the transition |
11 | 11 | $j.collapsibleTabs.moveToCollapsed = function( ele ) { |
12 | 12 | var $moving = $j( ele ); |
| 13 | + if ( $moving.size() == 0 ) { |
| 14 | + return; |
| 15 | + } |
13 | 16 | $j.collapsibleTabs.getSettings( $j( $j.collapsibleTabs.getSettings( $moving ).expandedContainer ) ).shifting = true; |
14 | 17 | var data = $j.collapsibleTabs.getSettings( $moving ); |
15 | 18 | // Remove the element from where it's at and put it in the dropdown menu |
— | — | @@ -30,6 +33,9 @@ |
31 | 34 | // Overloading the moveToExpanded function to animate the transition |
32 | 35 | $j.collapsibleTabs.moveToExpanded = function( ele ) { |
33 | 36 | var $moving = $j( ele ); |
| 37 | + if ( $moving.size() == 0 ) { |
| 38 | + return; |
| 39 | + } |
34 | 40 | $j.collapsibleTabs.getSettings( $j( $j.collapsibleTabs.getSettings( $moving ).expandedContainer ) ).shifting = true; |
35 | 41 | var data = $j.collapsibleTabs.getSettings( $moving ); |
36 | 42 | // grab the next appearing placeholder so we can use it for replacing |
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Vector.combined.js |
— | — | @@ -228,6 +228,9 @@ |
229 | 229 | // Overloading the moveToCollapsed function to animate the transition |
230 | 230 | $j.collapsibleTabs.moveToCollapsed = function( ele ) { |
231 | 231 | var $moving = $j( ele ); |
| 232 | + if ( $moving.size() == 0 ) { |
| 233 | + return; |
| 234 | + } |
232 | 235 | $j.collapsibleTabs.getSettings( $j( $j.collapsibleTabs.getSettings( $moving ).expandedContainer ) ).shifting = true; |
233 | 236 | var data = $j.collapsibleTabs.getSettings( $moving ); |
234 | 237 | // Remove the element from where it's at and put it in the dropdown menu |
— | — | @@ -249,6 +252,9 @@ |
250 | 253 | // Overloading the moveToExpanded function to animate the transition |
251 | 254 | $j.collapsibleTabs.moveToExpanded = function( ele ) { |
252 | 255 | var $moving = $j( ele ); |
| 256 | + if ( $moving.size() == 0 ) { |
| 257 | + return; |
| 258 | + } |
253 | 259 | $j.collapsibleTabs.getSettings( $j( $j.collapsibleTabs.getSettings( $moving ).expandedContainer ) ).shifting = true; |
254 | 260 | var data = $j.collapsibleTabs.getSettings( $moving ); |
255 | 261 | // grab the next appearing placeholder so we can use it for replacing |
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Vector.combined.min.js |
— | — | @@ -12,7 +12,9 @@ |
13 | 13 | $j('#mw-panel > div.portal:first').addClass('first persistent');$j('#mw-panel').addClass('collapsible-nav');$j('#mw-panel > div.portal:not(.persistent)').each(function(i){var id=$j(this).attr('id');var state=$j.cookie('vector-nav-'+id);if(state=='true'||(state==null&&i<1)||(state==null&&version==1&&id=='p-lang')){$j(this).addClass('expanded').find('div.body').show();}else{$j(this).addClass('collapsed');} |
14 | 14 | if(state!=null){$j.cookie('vector-nav-'+$j(this).attr('id'),state,{'expires':30,'path':'/'});}});function toggle($element){$j.cookie('vector-nav-'+$element.parent().attr('id'),$element.parent().is('.collapsed'),{'expires':30,'path':'/'});$element.parent().toggleClass('expanded').toggleClass('collapsed').find('div.body').slideToggle('fast');} |
15 | 15 | var $headings=$j('#mw-panel > div.portal:not(.persistent) > h5');var tabIndex=mw.usability.getMaxTabIndex()+1;$j('#searchInput').attr('tabindex',tabIndex++);$headings.each(function(){$j(this).attr('tabindex',tabIndex++);});$headings.keydown(function(event){if(event.which==13||event.which==32){toggle($j(this));}}).mousedown(function(){toggle($j(this));$j(this).blur();return false;});});$j(document).ready(function(){if(!wgVectorEnabledModules.collapsibletabs){return true;} |
16 | | -var rtl=$j('body').is('.rtl');$j.collapsibleTabs.moveToCollapsed=function(ele){var $moving=$j(ele);$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=true;var data=$j.collapsibleTabs.getSettings($moving);var target=data.collapsedContainer;$moving.css("position","relative").css((rtl?'left':'right'),0).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.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($j(ele)).expandedContainer)).shifting=false;$j.collapsibleTabs.handleResize();});};$j.collapsibleTabs.moveToExpanded=function(ele){var $moving=$j(ele);$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=true;var data=$j.collapsibleTabs.getSettings($moving);var $target=$j(data.expandedContainer).find('span.placeholder:first');var expandedWidth=data.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.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=false;$j.collapsibleTabs.handleResize();}));};$j('#p-views ul').bind("beforeTabCollapse",function(){if($j('#p-cactions').css('display')=='none') |
| 16 | +var rtl=$j('body').is('.rtl');$j.collapsibleTabs.moveToCollapsed=function(ele){var $moving=$j(ele);if($moving.size()==0){return;} |
| 17 | +$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=true;var data=$j.collapsibleTabs.getSettings($moving);var target=data.collapsedContainer;$moving.css("position","relative").css((rtl?'left':'right'),0).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.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($j(ele)).expandedContainer)).shifting=false;$j.collapsibleTabs.handleResize();});};$j.collapsibleTabs.moveToExpanded=function(ele){var $moving=$j(ele);if($moving.size()==0){return;} |
| 18 | +$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=true;var data=$j.collapsibleTabs.getSettings($moving);var $target=$j(data.expandedContainer).find('span.placeholder:first');var expandedWidth=data.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.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=false;$j.collapsibleTabs.handleResize();}));};$j('#p-views ul').bind("beforeTabCollapse",function(){if($j('#p-cactions').css('display')=='none') |
17 | 19 | $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) |
18 | 20 | $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;}}});});$j(document).ready(function(){if(!wgVectorEnabledModules.editwarning||$j('#wpTextbox1').size()==0){return true;} |
19 | 21 | $j('#wpTextbox1, #wpSummary').each(function(){$j(this).data('origtext',$j(this).val());});var fallbackWindowOnBeforeUnload=window.onbeforeunload;var ourWindowOnBeforeUnload=function(){var fallbackResult=undefined;var retval=undefined;var thisFunc=arguments.callee;if(fallbackWindowOnBeforeUnload){fallbackResult=fallbackWindowOnBeforeUnload();} |