Merge pull request #6535 from Slowlife01/focus-webpanel

enhance media focus handling to support sidebar opening
This commit is contained in:
mr. m
2025-03-18 07:44:55 +01:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -428,7 +428,10 @@ class ZenMediaController {
}
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() {

View File

@@ -280,8 +280,10 @@ class ZenBrowserManagerSidebar extends ZenDOMOperatedFeature {
this.close();
}
open() {
open(id = null) {
let sidebar = document.getElementById('zen-sidebar-web-panel');
if (id) this._currentPanel = id;
sidebar.removeAttribute('hidden');
this.update();
}