diff --git a/src/ZenEssentialsToolbar.mjs b/src/ZenEssentialsToolbar.mjs index 14446a0..0701875 100644 --- a/src/ZenEssentialsToolbar.mjs +++ b/src/ZenEssentialsToolbar.mjs @@ -1,8 +1,10 @@ class ZenEssentialsToolbar extends PlacesViewBase { - constructor(placesUrl, rootElt, viewElt) { + constructor(placesUrl) { + ZenEssentialsToolbar._initInitialLayout(); + // We'll initialize the places URL after ensuring the folder exists - super(null, rootElt, viewElt); + super(null, document.getElementById("EssentialsToolbarItems"), document.getElementById("EssentialsToolbar")); // Do initialization of properties that don't depend on Places this._init(); this._initPlacesFolder(); @@ -117,6 +119,29 @@ class ZenEssentialsToolbar extends PlacesViewBase { this._addEventListeners(window, ["unload"], false); } + static _initInitialLayout() { + const fragment = window.MozXULElement.parseXULToFragment(` + + + + + + + `); + + document.getElementById("vertical-pinned-tabs-container").before(fragment); + } + _cbEvents = [ "dragstart", "dragover", diff --git a/src/ZenSidebarManager.mjs b/src/ZenSidebarManager.mjs index 367bacc..1103b1b 100644 --- a/src/ZenSidebarManager.mjs +++ b/src/ZenSidebarManager.mjs @@ -783,27 +783,6 @@ class ZenBrowserManagerSidebar extends ZenDOMOperatedFeature { const url = gContextMenu.linkURL || gContextMenu.target.ownerDocument.location.href; this._createNewPanel(url); } - - toggleEssentialsAccordion(header) { - const content = document.getElementById('EssentialsToolbarItems'); - const isExpanded = header.hasAttribute('expanded'); - - if (isExpanded) { - // Collapse - header.removeAttribute('expanded'); - content.style.maxHeight = null; - content.style.opacity = '0'; - setTimeout(() => { - content.removeAttribute('expanded'); - }, 300); - } else { - // Expand - header.setAttribute('expanded', 'true'); - content.setAttribute('expanded', 'true'); - content.style.maxHeight = content.scrollHeight + "px"; - content.style.opacity = '1'; - } - } } window.gZenBrowserManagerSidebar = new ZenBrowserManagerSidebar();