Actions
Defect #33392
closedFix invalid selector in function displayTabsButtons()
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
Below it's a snippet from displayTabsButton()
function:
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);
}
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.
The attach patch fixes this incorrect behaviour and also replaces some inline styles with class hidden
.
Files
Related issues
Actions