feat: side bar playlist and other items not present on some screensizes. make completely responsive
Task #40 completed by ClaudeQueue ClaudeQueue
This commit is contained in:
@@ -1741,6 +1741,8 @@ function render() {
|
||||
listFilter = '';
|
||||
const fi = $('listFilterInput');
|
||||
if (fi) fi.value = '';
|
||||
// On mobile, navigating (nav item / playlist / search) dismisses the drawer.
|
||||
if (typeof closeSidebar === 'function') closeSidebar();
|
||||
exitSelectMode();
|
||||
renderSidebar();
|
||||
renderSmartSidebar();
|
||||
@@ -1977,7 +1979,38 @@ function closeModal() { $('modal').classList.add('hidden'); }
|
||||
// ============================================================================
|
||||
// Events
|
||||
// ============================================================================
|
||||
// ============================================================================
|
||||
// Responsive sidebar drawer (mobile)
|
||||
// ============================================================================
|
||||
function openSidebar() {
|
||||
const app = document.querySelector('.app');
|
||||
if (!app) return;
|
||||
app.classList.add('sidebar-open');
|
||||
const t = $('sidebarToggle');
|
||||
if (t) t.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
function closeSidebar() {
|
||||
const app = document.querySelector('.app');
|
||||
if (!app) return;
|
||||
app.classList.remove('sidebar-open');
|
||||
const t = $('sidebarToggle');
|
||||
if (t) t.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
function setupSidebarDrawer() {
|
||||
const toggle = $('sidebarToggle');
|
||||
const backdrop = $('sidebarBackdrop');
|
||||
if (toggle) {
|
||||
toggle.addEventListener('click', () => {
|
||||
const app = document.querySelector('.app');
|
||||
if (app && app.classList.contains('sidebar-open')) closeSidebar();
|
||||
else openSidebar();
|
||||
});
|
||||
}
|
||||
if (backdrop) backdrop.addEventListener('click', closeSidebar);
|
||||
}
|
||||
|
||||
function wireUI() {
|
||||
setupSidebarDrawer();
|
||||
els.searchForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const q = els.searchInput.value.trim();
|
||||
@@ -2233,7 +2266,9 @@ document.querySelectorAll('.chip').forEach((c) => {
|
||||
else if (e.key === 'b') { if (current) setAbB(); }
|
||||
else if (e.key === '?') toggleShortcutHelp();
|
||||
else if (e.key === 'Escape') {
|
||||
if (!$('shortcutHelp').classList.contains('hidden')) $('shortcutHelp').classList.add('hidden');
|
||||
const app = document.querySelector('.app');
|
||||
if (app && app.classList.contains('sidebar-open')) closeSidebar();
|
||||
else if (!$('shortcutHelp').classList.contains('hidden')) $('shortcutHelp').classList.add('hidden');
|
||||
else if (selectMode) { exitSelectMode(); renderList(); }
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user