Skip to content

Commit b301eea

Browse files
committed
Overflow pinned tabs correctly
1 parent 58f7f7c commit b301eea

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

webextensions/sidebar/pinned-tabs.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import * as GapCanceller from './gap-canceller.js';
4141
import * as SidebarTabs from './sidebar-tabs.js';
4242
import * as Size from './size.js';
4343

44-
// eslint-disable-next-line no-unused-vars
4544
function log(...args) {
4645
internalLogger('sidebar/pinned-tabs', ...args);
4746
}
@@ -81,8 +80,6 @@ export function reposition(options = {}) {
8180
Math.floor(maxWidth / width)
8281
) : 1;
8382
const maxRow = Math.ceil(pinnedTabs.length / maxCol);
84-
let col = 0;
85-
let row = 0;
8683

8784
const pinnedTabsAreaRatio = Math.min(Math.max(0, configs.maxPinnedTabsRowsAreaPercentage), 100) / 100;
8885
const allTabsAreaHeight = Size.getAllTabsAreaSize() + GapCanceller.getOffset();
@@ -101,6 +98,8 @@ export function reposition(options = {}) {
10198

10299
Size.updateContainers();
103100

101+
let col = 1;
102+
let row = 1;
104103
for (const tab of pinnedTabs) {
105104
if (options.justNow)
106105
tab.$TST.removeState(Constants.kTAB_STATE_ANIMATION_READY);
@@ -127,7 +126,9 @@ export function reposition(options = {}) {
127126
//log('=> new row');
128127
}
129128
}
130-
SidebarTabs.pinnedContainer.classList.toggle('overflow', contentsHeight > mAreaHeight);
129+
log('reposition: ', { maxWidth, faviconized, width, height, maxCol, maxRow, pinnedTabsAreaRatio, allTabsAreaHeight, mMaxVisibleRows, mAreaHeight, col, row });
130+
log('overflow: contentsHeight > mAreaHeight : ', contentsHeight > mAreaHeight, ' , row > maxRow : ', row > maxRow);
131+
SidebarTabs.pinnedContainer.classList.toggle('overflow', contentsHeight > mAreaHeight || row > maxRow);
131132
}
132133

133134
export function reserveToReposition(options = {}) {

0 commit comments

Comments
 (0)