mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 17:36:34 +00:00
Flash sidebar on tab select in compact mode.
This commit is contained in:
@@ -110,6 +110,8 @@ var gZenVerticalTabsManager = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var gZenCompactModeManager = {
|
var gZenCompactModeManager = {
|
||||||
|
_flashSidebarTimeout: null,
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
Services.prefs.addObserver('zen.view.compact', this._updateEvent.bind(this));
|
Services.prefs.addObserver('zen.view.compact', this._updateEvent.bind(this));
|
||||||
},
|
},
|
||||||
@@ -135,6 +137,27 @@ var gZenCompactModeManager = {
|
|||||||
sidebar.toggleAttribute('zen-user-show');
|
sidebar.toggleAttribute('zen-user-show');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
flashSidebar() {
|
||||||
|
let sidebar = document.getElementById('navigator-toolbox');
|
||||||
|
if (sidebar.matches(':hover')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this._flashSidebarTimeout) {
|
||||||
|
clearTimeout(this._flashSidebarTimeout);
|
||||||
|
} else {
|
||||||
|
window.requestAnimationFrame(() =>
|
||||||
|
sidebar.setAttribute('flash-popup', '')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
this._flashSidebarTimeout =
|
||||||
|
setTimeout(() => {
|
||||||
|
window.requestAnimationFrame(() => {
|
||||||
|
sidebar.removeAttribute('flash-popup')
|
||||||
|
this._flashSidebarTimeout = null;
|
||||||
|
});
|
||||||
|
}, 1600);
|
||||||
|
},
|
||||||
|
|
||||||
toggleToolbar() {
|
toggleToolbar() {
|
||||||
let toolbar = document.getElementById('zen-appcontent-navbar-container');
|
let toolbar = document.getElementById('zen-appcontent-navbar-container');
|
||||||
toolbar.toggleAttribute('zen-user-show');
|
toolbar.toggleAttribute('zen-user-show');
|
||||||
|
@@ -95,6 +95,7 @@
|
|||||||
#navigator-toolbox:hover,
|
#navigator-toolbox:hover,
|
||||||
#navigator-toolbox:focus-within,
|
#navigator-toolbox:focus-within,
|
||||||
#navigator-toolbox[zen-user-show],
|
#navigator-toolbox[zen-user-show],
|
||||||
|
#navigator-toolbox[flash-popup],
|
||||||
#navigator-toolbox[movingtab],
|
#navigator-toolbox[movingtab],
|
||||||
#mainPopupSet:has(> #appMenu-popup:hover) ~ toolbox,
|
#mainPopupSet:has(> #appMenu-popup:hover) ~ toolbox,
|
||||||
#navigator-toolbox:has(.tabbrowser-tab:active),
|
#navigator-toolbox:has(.tabbrowser-tab:active),
|
||||||
@@ -187,6 +188,7 @@
|
|||||||
#navigator-toolbox:hover,
|
#navigator-toolbox:hover,
|
||||||
#navigator-toolbox:focus-within,
|
#navigator-toolbox:focus-within,
|
||||||
#navigator-toolbox[zen-user-show],
|
#navigator-toolbox[zen-user-show],
|
||||||
|
#navigator-toolbox[flash-popup],
|
||||||
#navigator-toolbox[movingtab],
|
#navigator-toolbox[movingtab],
|
||||||
#mainPopupSet:has(> #appMenu-popup:hover) ~ toolbox,
|
#mainPopupSet:has(> #appMenu-popup:hover) ~ toolbox,
|
||||||
#navigator-toolbox:has(.tabbrowser-tab:active),
|
#navigator-toolbox:has(.tabbrowser-tab:active),
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
|
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
|
||||||
index 282e7f31fe158d929130c17628f7e30f690fd666..2eb7123611947c5bc3da4ae864dd6f6f68fa6f9e 100644
|
index 282e7f31fe158d929130c17628f7e30f690fd666..c4e231382846ab646fadb6544fa7d78fdcdf7769 100644
|
||||||
--- a/browser/components/tabbrowser/content/tabs.js
|
--- a/browser/components/tabbrowser/content/tabs.js
|
||||||
+++ b/browser/components/tabbrowser/content/tabs.js
|
+++ b/browser/components/tabbrowser/content/tabs.js
|
||||||
@@ -1387,9 +1387,7 @@
|
@@ -1387,10 +1387,11 @@
|
||||||
|
|
||||||
_handleTabSelect(aInstant) {
|
_handleTabSelect(aInstant) {
|
||||||
let selectedTab = this.selectedItem;
|
let selectedTab = this.selectedItem;
|
||||||
@@ -11,5 +11,9 @@ index 282e7f31fe158d929130c17628f7e30f690fd666..2eb7123611947c5bc3da4ae864dd6f6f
|
|||||||
- }
|
- }
|
||||||
+ this.arrowScrollbox.ensureElementIsVisible(selectedTab, aInstant);
|
+ this.arrowScrollbox.ensureElementIsVisible(selectedTab, aInstant);
|
||||||
|
|
||||||
|
+ if (!aInstant && Services.prefs.getBoolPref('zen.view.compact')) {
|
||||||
|
+ gZenCompactModeManager.flashSidebar();
|
||||||
|
+ }
|
||||||
selectedTab._notselectedsinceload = false;
|
selectedTab._notselectedsinceload = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user