mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-16 06:46:12 +00:00
Refactor ZenCompactMode hover animation handling and add check for ZenWorkspaces existence in browserPlacesViews
This commit is contained in:
@@ -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'));
|
||||||
this._animatingElements[target.id] = true;
|
if (target.id === 'navigator-toolbox' && gZenCompactModeManager.prefefence) {
|
||||||
setTimeout(() => {
|
this._animatingElements[target.id] = true;
|
||||||
delete this._animatingElements[target.id];
|
setTimeout(() => {
|
||||||
}, 312.5); // 0.3125s is the duration of the sidebar animation (the longest one)
|
delete this._animatingElements[target.id];
|
||||||
|
}, 312.5); // 0.3125s is the duration of the sidebar animation (the longest one)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
target.addEventListener('mouseleave', (event) => {
|
target.addEventListener('mouseleave', (event) => {
|
||||||
|
@@ -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 {
|
||||||
|
Reference in New Issue
Block a user