Bug 1456056 - Part 2. Display chevron button only if the devtool width is narrow.r=jdescottes

This patch will allow that all buttons which accessing the tool panel is
overflowed. i.e. toolbar will display chevron button only.

MozReview-Commit-ID: GbKbAhtpYt7

--HG--
extra : rebase_source : 971aef121c329e6a5ba3ada24015a1d820aab26a
This commit is contained in:
Mantaroh Yoshinaga 2018-05-31 10:23:36 +09:00
Родитель f09e3bd9dc
Коммит 4682781417
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -165,11 +165,12 @@ class ToolboxTabs extends Component {
let removingToolWidth = this._cachedToolTabsWidthMap.get(removingToolId);
sumWidth -= removingToolWidth;
}
visibleTabs.push(currentToolId);
}
if (visibleTabs.length === 0) {
visibleTabs = [enabledTabs[0]];
// If toolbox width is narrow, toolbox display only chevron menu.
// i.e. All tool tabs will overflow.
if ((sumWidth + selectedToolWidth) <= toolboxWidth) {
visibleTabs.push(currentToolId);
}
}
let willOverflowTabs = enabledTabs.filter(id => !visibleTabs.includes(id));