Hide toolbar buttons and workspace indicator in specific conditions

This commit is contained in:
mr. M
2024-11-10 18:04:47 +01:00
parent ded9ee3251
commit 056de6fc13
2 changed files with 3 additions and 1 deletions

View File

@@ -83,11 +83,12 @@ export var ZenCustomizableUI = new (class {
}
_hideToolbarButtons(window) {
const wrapper = window.document.getElementById('zen-sidebar-icons-wrapper');
const elementsToHide = ['alltabs-button', 'new-tab-button'];
for (let id of elementsToHide) {
const elem = window.document.getElementById(id);
if (elem) {
elem.setAttribute('hidden', 'true');
wrapper.prepend(elem);
}
}
}

View File

@@ -15,6 +15,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
async init() {
if (!this.shouldHaveWorkspaces) {
document.getElementById('zen-current-workspace-indicator').setAttribute('hidden', 'true');
console.warn('ZenWorkspaces: !!! ZenWorkspaces is disabled in hidden windows !!!');
return; // We are in a hidden window, don't initialize ZenWorkspaces
}