mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Hide toolbar buttons and workspace indicator in specific conditions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user