mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-06 09:56:36 +00:00
enhance media focus handling to support sidebar opening
This commit is contained in:
@@ -428,7 +428,10 @@ class ZenMediaController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMediaFocus() {
|
onMediaFocus() {
|
||||||
this._currentMediaController?.focus();
|
if (!this._currentBrowser) return;
|
||||||
|
const sidebarId = this._currentBrowser.getAttribute('zen-sidebar-id');
|
||||||
|
if (sidebarId) gZenBrowserManagerSidebar.open(sidebarId);
|
||||||
|
else this._currentMediaController?.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMediaMute() {
|
onMediaMute() {
|
||||||
|
@@ -280,8 +280,10 @@ class ZenBrowserManagerSidebar extends ZenDOMOperatedFeature {
|
|||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
open() {
|
open(id = null) {
|
||||||
let sidebar = document.getElementById('zen-sidebar-web-panel');
|
let sidebar = document.getElementById('zen-sidebar-web-panel');
|
||||||
|
if (id) this._currentPanel = id;
|
||||||
|
|
||||||
sidebar.removeAttribute('hidden');
|
sidebar.removeAttribute('hidden');
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user