Skip to content

Commit 09ee6f2

Browse files
committed
fix: Fixed create button hiding and reshowing when clicked multiple times, b=no-bug, c=common, workspaces
1 parent bf6e493 commit 09ee6f2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/zen/common/ZenCustomizableUI.sys.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,16 @@ export var ZenCustomizableUI = new (class {
107107
_initCreateNewButton(window) {
108108
const button = window.document.getElementById('zen-create-new-button');
109109
button.addEventListener('command', () => {
110-
if (button.hasAttribute('zen-ignore-open')) {
110+
if (button.hasAttribute('open')) {
111111
return;
112112
}
113113
const image = button.querySelector('image');
114114
const popup = window.document.getElementById('zenCreateNewPopup');
115-
button.setAttribute('zen-ignore-open', 'true');
115+
button.setAttribute('open', 'true');
116116
const handlePopupHidden = () => {
117-
button.removeAttribute('zen-ignore-open');
117+
window.setTimeout(() => {
118+
button.removeAttribute('open');
119+
}, 100);
118120
window.gZenUIManager.motion.animate(
119121
image,
120122
{ transform: ['rotate(45deg)', 'rotate(0deg)'] },

src/zen/workspaces/ZenWorkspaceCreation.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@
303303
gURLBar.textbox.style.opacity = 0;
304304
}
305305

306+
this.remove();
306307
gZenUIManager.updateTabsToolbar();
307308

308309
const workspace = await gZenWorkspaces.getActiveWorkspace();
@@ -320,6 +321,7 @@
320321
bounce: 0,
321322
}
322323
);
324+
323325
gBrowser.tabContainer.style.opacity = '';
324326
if (gZenVerticalTabsManager._hasSetSingleToolbar) {
325327
gURLBar.textbox.style.opacity = '';
@@ -330,8 +332,6 @@
330332
}
331333

332334
this.#hiddenElements = [];
333-
334-
this.remove();
335335
}
336336
}
337337

0 commit comments

Comments
 (0)