fix: Fixed create button hiding and reshowing when clicked multiple times, b=no-bug, c=common, workspaces

This commit is contained in:
mr. m
2025-06-13 11:11:27 +02:00
parent bf6e493f89
commit 09ee6f2097
2 changed files with 7 additions and 5 deletions

View File

@@ -107,14 +107,16 @@ export var ZenCustomizableUI = new (class {
_initCreateNewButton(window) {
const button = window.document.getElementById('zen-create-new-button');
button.addEventListener('command', () => {
if (button.hasAttribute('zen-ignore-open')) {
if (button.hasAttribute('open')) {
return;
}
const image = button.querySelector('image');
const popup = window.document.getElementById('zenCreateNewPopup');
button.setAttribute('zen-ignore-open', 'true');
button.setAttribute('open', 'true');
const handlePopupHidden = () => {
button.removeAttribute('zen-ignore-open');
window.setTimeout(() => {
button.removeAttribute('open');
}, 100);
window.gZenUIManager.motion.animate(
image,
{ transform: ['rotate(45deg)', 'rotate(0deg)'] },

View File

@@ -303,6 +303,7 @@
gURLBar.textbox.style.opacity = 0;
}
this.remove();
gZenUIManager.updateTabsToolbar();
const workspace = await gZenWorkspaces.getActiveWorkspace();
@@ -320,6 +321,7 @@
bounce: 0,
}
);
gBrowser.tabContainer.style.opacity = '';
if (gZenVerticalTabsManager._hasSetSingleToolbar) {
gURLBar.textbox.style.opacity = '';
@@ -330,8 +332,6 @@
}
this.#hiddenElements = [];
this.remove();
}
}