feat: hide foreground webapp when switching sidebar pages
This commit is contained in:
@@ -24,6 +24,15 @@ const router = {
|
||||
this.current = id;
|
||||
document.querySelectorAll('[data-page]').forEach(el =>
|
||||
el.classList.toggle('active', el.dataset.page === id));
|
||||
// 切页时把前台 webapp 丢到后台(隐藏内容 WebView,标签状态保留)
|
||||
// Hide the foreground webapp when switching pages (keep tab state)
|
||||
bridge.call('hideWebApps').catch(() => {});
|
||||
// 同时隐藏 webapp 顶栏与标签面板(离开 webapp 场景)
|
||||
// Also hide the webapp topbar and tab panel (leaving the webapp context)
|
||||
const topbar = document.getElementById('web-topbar');
|
||||
if (topbar) topbar.style.display = 'none';
|
||||
const tabPanel = document.getElementById('tab-panel');
|
||||
if (tabPanel) tabPanel.style.display = 'none';
|
||||
// 非首页时侧边栏顶部显示小时间(容器始终占位,仅切换可见性避免撑动图标)
|
||||
// Show the small clock at the sidebar top when not on home (the container
|
||||
// always occupies space; only toggle visibility to avoid shifting icons)
|
||||
|
||||
Reference in New Issue
Block a user