Skip to content

Commit

Permalink
Update ZenWorkspaces.mjs
Browse files Browse the repository at this point in the history
Signed-off-by: Studio Movie Girl <[email protected]>
  • Loading branch information
neurokitti authored Dec 23, 2024
1 parent 2a06601 commit f90bc04
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/browser/base/zen-components/ZenWorkspaces.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
console.warn('ZenWorkspaces: !!! ZenWorkspaces is disabled in hidden windows !!!');
return; // We are in a hidden window, don't initialize ZenWorkspaces
}

this.ownerWindow = window;
XPCOMUtils.defineLazyPreferenceGetter(
this,
Expand Down Expand Up @@ -113,7 +112,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
window.addEventListener("AppCommand", HandleAppCommandEvent, true);
}


_handleAppCommand(event) {
if (!this.workspaceEnabled || !this._hoveringSidebar) {
return;
Expand Down Expand Up @@ -447,11 +445,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
activeWorkspace = await this.getActiveWorkspace();
if (!activeWorkspace) {
activeWorkspace = workspaces.workspaces.find((workspace) => workspace.default);
this.activeWorkspace = activeWorkspace.uuid;
this.activeWorkspace = activeWorkspace?.uuid;
}
if (!activeWorkspace) {
activeWorkspace = workspaces.workspaces[0];
this.activeWorkspace = activeWorkspace.uuid;
this.activeWorkspace = activeWorkspace?.uuid;
}
await this.changeWorkspace(activeWorkspace, true);
}
Expand Down Expand Up @@ -592,7 +590,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
// Clear the search input field
searchInput.value = '';
for (let button of container.querySelectorAll('.toolbarbutton-1')) {
button.style.display = ''; // Reset the display when cleared
button.style.display = '';
}
}

Expand Down Expand Up @@ -631,26 +629,23 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
}


// Add event listener for filtering logic

searchInput.addEventListener('input', (event) => {
const query = event.target.value.toLowerCase();
if (query !== '') {
for (let button of container.querySelectorAll('.toolbarbutton-1')) {
button.style.display = 'none'; // Reset the display when cleared
button.style.display = 'none';
}
let filteredIcons = this.searchIcons(query, emojies);

// Remove all buttons from the container
const buttons = Array.from(container.querySelectorAll('.toolbarbutton-1'));


// Append the filtered icons in order
for (let emoji of filteredIcons) {
for (let button of buttons) {
if (button.label === emoji) {
container.appendChild(button);
button.style.display = '';

}
}
}
Expand Down

0 comments on commit f90bc04

Please sign in to comment.