From 72396b8f55f74b0bc8e47d0fde89160622d1839b Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Wed, 18 Sep 2024 22:05:31 +0200 Subject: [PATCH] Refactor ZenSidebarManager to adjust parentRelativeHeight calculation --- src/ZenSidebarManager.mjs | 2 +- src/ZenWorkspaces.mjs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ZenSidebarManager.mjs b/src/ZenSidebarManager.mjs index 71f2e8e..298ca30 100644 --- a/src/ZenSidebarManager.mjs +++ b/src/ZenSidebarManager.mjs @@ -79,7 +79,7 @@ var gZenBrowserManagerSidebar = { // relative to avoid the top margin // 20px is the padding let parentRelativeHeight = - parent.getBoundingClientRect().height - parent.getBoundingClientRect().top + sidebar.getBoundingClientRect().top - 20; + parent.getBoundingClientRect().height - parent.getBoundingClientRect().top + sidebar.getBoundingClientRect().top - 30; let minHeight = parseInt(computedStyle.getPropertyValue('min-height').replace('px', '')); if (!this._isDragging) { // Prevent multiple resizes diff --git a/src/ZenWorkspaces.mjs b/src/ZenWorkspaces.mjs index 09ae4b1..ca3d49f 100644 --- a/src/ZenWorkspaces.mjs +++ b/src/ZenWorkspaces.mjs @@ -344,14 +344,14 @@ var ZenWorkspaces = { button.removeAttribute('hidden'); return; } - let browserTabs = document.getElementById('tabbrowser-tabs'); + const nextSibling = document.getElementById('zen-sidepanel-button'); let button = document.createElement('toolbarbutton'); button.id = 'zen-workspaces-button'; button.className = 'toolbarbutton-1 chromeclass-toolbar-additional'; button.setAttribute('label', 'Workspaces'); button.setAttribute('tooltiptext', 'Workspaces'); button.onclick = this.openWorkspacesDialog.bind(this); - browserTabs.insertAdjacentElement('beforebegin', button); + nextSibling.before(button); }, async _updateWorkspacesButton() {