Refactor ZenCompactMode hover animation handling and add check for ZenWorkspaces existence in browserPlacesViews

This commit is contained in:
mr. M
2025-01-14 20:42:25 +01:00
parent dd5461273c
commit 270af0ff00
2 changed files with 9 additions and 7 deletions

View File

@@ -318,10 +318,12 @@ var gZenCompactModeManager = {
target.addEventListener('mouseenter', (event) => { target.addEventListener('mouseenter', (event) => {
this.clearFlashTimeout('has-hover' + target.id); this.clearFlashTimeout('has-hover' + target.id);
window.requestAnimationFrame(() => target.setAttribute('zen-has-hover', 'true')); window.requestAnimationFrame(() => target.setAttribute('zen-has-hover', 'true'));
if (target.id === 'navigator-toolbox' && gZenCompactModeManager.prefefence) {
this._animatingElements[target.id] = true; this._animatingElements[target.id] = true;
setTimeout(() => { setTimeout(() => {
delete this._animatingElements[target.id]; delete this._animatingElements[target.id];
}, 312.5); // 0.3125s is the duration of the sidebar animation (the longest one) }, 312.5); // 0.3125s is the duration of the sidebar animation (the longest one)
}
}); });
target.addEventListener('mouseleave', (event) => { target.addEventListener('mouseleave', (event) => {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/places/content/browserPlacesViews.js b/browser/components/places/content/browserPlacesViews.js diff --git a/browser/components/places/content/browserPlacesViews.js b/browser/components/places/content/browserPlacesViews.js
index 1bfa0af16178c9b42172bc1b1e0249d28ff8e9e6..417a9dc4e55208bdc9c1422a3bae14361a4964c5 100644 index 1bfa0af16178c9b42172bc1b1e0249d28ff8e9e6..cefe17335cb7cc1a22182f2e79c564237b9ae5e8 100644
--- a/browser/components/places/content/browserPlacesViews.js --- a/browser/components/places/content/browserPlacesViews.js
+++ b/browser/components/places/content/browserPlacesViews.js +++ b/browser/components/places/content/browserPlacesViews.js
@@ -330,12 +330,23 @@ class PlacesViewBase { @@ -330,12 +330,23 @@ class PlacesViewBase {
@@ -13,7 +13,7 @@ index 1bfa0af16178c9b42172bc1b1e0249d28ff8e9e6..417a9dc4e55208bdc9c1422a3bae1436
+ let child = resultNode.getChild(i); + let child = resultNode.getChild(i);
+ // Skip nodes that don't belong in current workspace + // Skip nodes that don't belong in current workspace
+ if (PlacesUtils.nodeIsURI(child) || PlacesUtils.containerTypes.includes(child.type)) { + if (PlacesUtils.nodeIsURI(child) || PlacesUtils.containerTypes.includes(child.type)) {
+ if (ZenWorkspaces.isBookmarkInAnotherWorkspace(child)) { + if (typeof ZenWorkspaces !== 'undefined' && ZenWorkspaces.isBookmarkInAnotherWorkspace(child)) {
+ continue; + continue;
+ } + }
+ } + }
@@ -52,7 +52,7 @@ index 1bfa0af16178c9b42172bc1b1e0249d28ff8e9e6..417a9dc4e55208bdc9c1422a3bae1436
+ for (let i = 0; i < cc; i++) { + for (let i = 0; i < cc; i++) {
+ let child = this._resultNode.getChild(i); + let child = this._resultNode.getChild(i);
+ if (PlacesUtils.nodeIsURI(child) || PlacesUtils.containerTypes.includes(child.type)) { + if (PlacesUtils.nodeIsURI(child) || PlacesUtils.containerTypes.includes(child.type)) {
+ if (!ZenWorkspaces.isBookmarkInAnotherWorkspace(child)) { + if (!(typeof ZenWorkspaces !== 'undefined' && ZenWorkspaces.isBookmarkInAnotherWorkspace(child))) {
+ visibleNodes.push(child); + visibleNodes.push(child);
+ } + }
+ } else { + } else {