Project

General

Profile

Defect #33392

Updated by Marius BÄ‚LTEANU about 4 years ago

Below it's a snippet from @displayTabsButton()@ function: 
 <pre><code class="js"> 
     var bw = $(el).parents('div.tabs-buttons').outerWidth(true); 

     if ((tabsWidth < el.width() - bw) && (lis.length === 0 || lis.first().is(':visible'))) { 
       el.find('div.tabs-buttons').hide(); 
     } else { 
       el.find('div.tabs-buttons').show().children('button.tab-left').toggleClass('disabled', numHidden == 0); 
     } 
 </code></pre> 

 Selector @parents('div.tabs-buttons')@ from line @var bw = $(el).parents('div.tabs-buttons').outerWidth(true);@ never finds any element because @div.tabs-buttons@ is not a parent of @div.tabs@.  

 On jQuery 2, @var gw = $(el).parents('div.tabs-buttons').outerWidth(true);@ is null which means 0+. 
 On jQuery 3, @var gw = $(el).parents('div.tabs-buttons').outerWidth(true);@ is undefined which means NaN. 

 Because of this change, the condition @(tabsWidth < el.width() - bw)@ always return false on jQuery 3 because @gw@ is NaN and tabsButton are displayed. Nan.  
 !tabs.png! 

 The attach patch fixes this incorrect behaviour and also replaces drops some inline styles with class @hidden@. styles.

Back