Skip to content

Commit a75323f

Browse files
committed
update navbarToolbarButtonSlider.uc.js:
don't move non-overflowable buttons to the overflow panel. for example, the downloads button isn't supposed to overflow. so when the slider overflows, move the overflowable buttons to the panel and unpack the other buttons in place (where the slider was).
1 parent 636056d commit a75323f

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

JS/atoolboxButton.uc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ const toolboxButtonL10n = {
426426
let shortcut = hotkey ? ` (${ShortcutUtils.prettifyShortcut(hotkey)})` : "";
427427
toolbarbutton.label = labelString;
428428
label.value = labelString;
429-
toolbarbutton.tooltipText = `${labelString}${shortcut}`;
429+
toolbarbutton.tooltipText = labelString + shortcut;
430430
};
431431

432432
// remove this window's observers when the window closes, since observers are global

JS/navbarToolbarButtonSlider.uc.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Navbar Toolbar Button Slider
3-
// @version 2.8.2
3+
// @version 2.8.3
44
// @author aminomancer
55
// @homepage https://github.com/aminomancer
66
// @description Wrap all toolbar buttons in a scrollable container. It can
@@ -342,7 +342,9 @@ class NavbarToolbarSlider {
342342
let overflown = this.isOverflowing;
343343
let array = [...this.widgets].filter(this.filterFn, this);
344344
if (overflown) {
345-
this.wrapAll(array, this.cOverflow);
345+
array.forEach(button => {
346+
if (button.getAttribute("overflows") !== "false") this.cOverflow.appendChild(button);
347+
});
346348
this.cOverflow.insertBefore(this.outer, this.cOverflow.firstElementChild);
347349
} else this.wrapAll(array, this.inner);
348350
this.outer.hidden = overflown;
@@ -351,9 +353,12 @@ class NavbarToolbarSlider {
351353
onWidgetOverflow(aNode, aContainer) {
352354
if (aNode.ownerGlobal !== window) return;
353355
if (aNode === this.outer && aContainer === this.cTarget) {
354-
NavbarToolbarSlider.appendLoop(this.kids, this.cOverflow);
356+
[...this.kids].forEach(button => {
357+
if (button.getAttribute("overflows") === "false") {
358+
this.cTarget.insertBefore(button, this.outer);
359+
} else this.cOverflow.appendChild(button);
360+
});
355361
this.outer.hidden = true;
356-
this.reOrder();
357362
}
358363
}
359364
onWidgetUnderflow(aNode, aContainer) {

0 commit comments

Comments
 (0)