mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
fix: Fixed create button hiding and reshowing when clicked multiple times, b=no-bug, c=common, workspaces
This commit is contained in:
@@ -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)'] },
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user