mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-07 10:26:36 +00:00
Refactor zen-glance animation and improve tab context handling
This commit is contained in:
@@ -108,9 +108,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&[animate-full='true'] {
|
&[animate-full='true'] {
|
||||||
opacity: 1;
|
transform: translate(-50%, -50%);
|
||||||
animation: zen-glance-buttons-animation-full 0.2s ease-in-out forwards !important;
|
|
||||||
|
|
||||||
& #zen-glance-sidebar-container {
|
& #zen-glance-sidebar-container {
|
||||||
opacity: 0 !important;
|
opacity: 0 !important;
|
||||||
}
|
}
|
||||||
|
@@ -67,7 +67,9 @@
|
|||||||
};
|
};
|
||||||
this.currentParentTab = currentTab;
|
this.currentParentTab = currentTab;
|
||||||
const newTab = existingTab ?? gBrowser.addTrustedTab(Services.io.newURI(url).spec, newTabOptions);
|
const newTab = existingTab ?? gBrowser.addTrustedTab(Services.io.newURI(url).spec, newTabOptions);
|
||||||
|
if (currentTab.hasAttribute('zenDefaultUserContextId')) {
|
||||||
|
newTab.setAttribute('zenDefaultUserContextId', true);
|
||||||
|
}
|
||||||
gBrowser.selectedTab = newTab;
|
gBrowser.selectedTab = newTab;
|
||||||
currentTab.querySelector('.tab-content').appendChild(newTab);
|
currentTab.querySelector('.tab-content').appendChild(newTab);
|
||||||
newTab.setAttribute('zen-glance-tab', true);
|
newTab.setAttribute('zen-glance-tab', true);
|
||||||
@@ -89,7 +91,6 @@
|
|||||||
this.browserWrapper?.removeAttribute('animate');
|
this.browserWrapper?.removeAttribute('animate');
|
||||||
this.browserWrapper?.removeAttribute('animate-end');
|
this.browserWrapper?.removeAttribute('animate-end');
|
||||||
this.browserWrapper?.removeAttribute('animate-full');
|
this.browserWrapper?.removeAttribute('animate-full');
|
||||||
this.browserWrapper?.removeAttribute('animate-full-end');
|
|
||||||
this.browserWrapper?.removeAttribute('has-finished-animation');
|
this.browserWrapper?.removeAttribute('has-finished-animation');
|
||||||
this.overlay?.removeAttribute('post-fade-out');
|
this.overlay?.removeAttribute('post-fade-out');
|
||||||
|
|
||||||
@@ -363,16 +364,19 @@
|
|||||||
this.#currentTab.removeAttribute('zen-glance-tab');
|
this.#currentTab.removeAttribute('zen-glance-tab');
|
||||||
gBrowser.selectedTab = this.#currentTab;
|
gBrowser.selectedTab = this.#currentTab;
|
||||||
this.currentParentTab.linkedBrowser.closest('.browserSidebarContainer').classList.remove('zen-glance-background');
|
this.currentParentTab.linkedBrowser.closest('.browserSidebarContainer').classList.remove('zen-glance-background');
|
||||||
setTimeout(() => {
|
gZenUIManager.motion.animate(this.browserWrapper, {
|
||||||
window.requestAnimationFrame(() => {
|
width: ['85%', '100%'],
|
||||||
this.browserWrapper.setAttribute('animate-full-end', true);
|
height: ['100%', '100%'],
|
||||||
|
}, {
|
||||||
|
duration: 0.4,
|
||||||
|
type: 'spring',
|
||||||
|
}).then(() => {
|
||||||
|
this.browserWrapper.removeAttribute('animate-full');
|
||||||
this.overlay.classList.remove('zen-glance-overlay');
|
this.overlay.classList.remove('zen-glance-overlay');
|
||||||
setTimeout(() => {
|
this.browserWrapper.removeAttribute('style');
|
||||||
this.animatingFullOpen = false;
|
this.animatingFullOpen = false;
|
||||||
this.closeGlance({ noAnimation: true });
|
this.closeGlance({ noAnimation: true });
|
||||||
}, 600);
|
|
||||||
});
|
});
|
||||||
}, 300);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
openGlanceForBookmark(event) {
|
openGlanceForBookmark(event) {
|
||||||
|
Reference in New Issue
Block a user