Refactor tab management and drag-and-drop functionality; improve animation durations and conditions for splitting tabs.

This commit is contained in:
mr. M
2025-03-02 21:36:31 +01:00
parent 7646c43f45
commit 0cb7b0af95
5 changed files with 82 additions and 49 deletions

View File

@@ -600,7 +600,10 @@
}
addToEssentials(tab) {
const tabs = tab ? [tab] : TabContextMenu.contextTab.multiselected ? gBrowser.selectedTabs : [TabContextMenu.contextTab];
const tabs = tab ? (
// if it's already an array, dont make it [tab]
tab?.length ? tab : [tab]
) : TabContextMenu.contextTab.multiselected ? gBrowser.selectedTabs : [TabContextMenu.contextTab];
for (let i = 0; i < tabs.length; i++) {
const tab = tabs[i];
if (tab.hasAttribute('zen-essential')) {