Skip to content

Commit

Permalink
💄 Add ability to hide statuspanel from customizable UI on web contents
Browse files Browse the repository at this point in the history
  • Loading branch information
kierandrewett committed Nov 22, 2023
1 parent fed84b3 commit 0dd7c65
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 12 deletions.
52 changes: 40 additions & 12 deletions components/tabs/content/browser-web-contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,60 @@ class BrowserWebContents extends MozHTMLElement {
};
}

getComputedAABBCollisions() {}

connectedCallback() {
if (this.delayConnectedCallback()) return;

this.setAttribute("borders", "top bottom");

this.appendChild(
html(
"div",
{ class: "wc-container" },
get bordersElement() {
return /** @type {HTMLDivElement} */ (
this.querySelector(".wc-borders") ||
html(
"div",
{ class: "wc-borders" },
this.elements.topLine,
this.elements.leftLine,
this.elements.rightLine,
this.elements.bottomLine
),
)
);
}

get slotContainerElement() {
return /** @type {HTMLDivElement} */ (
this.querySelector(".wc-slot") ||
html(
"div",
{ class: "wc-slot" },
html("slot", { name: "web-contents" })
)
);
}

/**
* The tabpanel connected to this web contents element
*/
get tabpanel() {
return this.slotContainerElement
.querySelector("slot")
.assignedElements()[0];
}

getComputedAABBCollisions() {}

connectedCallback() {
if (this.delayConnectedCallback()) return;

this.setAttribute("borders", "top bottom");

this.appendChild(
html(
"div",
{ class: "wc-container" },
this.bordersElement,
this.slotContainerElement
)
);

this.tabpanel.toggleAttribute(
"showstatuspanel",
this.hasAttribute("statuspanel")
);
}
}

Expand Down
4 changes: 4 additions & 0 deletions themes/shared/browser-shared.css
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ hr.fdn-separator {
-moz-window-dragging: no-drag;
}

#tabspanel:not([showstatuspanel]) browser-status {
display: none;
}

:disabled {
opacity: 0.5;
pointer-events: none;
Expand Down

0 comments on commit 0dd7c65

Please sign in to comment.