Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h1 class="brand-title">Ruh Al Tarikh</h1>
<i class="fas fa-bookmark" aria-hidden="true"></i>
<span class="badge" id="watchLaterBadge">0</span>
</button>
<button id="dashboardBtn" class="action-btn" aria-label="View Dashboard" title="View Dashboard">
<button id="dashboardBtn" class="action-btn" aria-label="View Dashboard" title="View Dashboard (D)" aria-controls="dashboardModal" aria-expanded="false">
<i class="fas fa-chart-line" aria-hidden="true"></i>
</button>
<a href="https://www.youtube.com/@Ruh-Al-Tarikh" target="_blank" rel="noopener noreferrer" class="action-btn" aria-label="Visit YouTube Channel" title="Visit YouTube Channel">
Expand Down
15 changes: 14 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ function openDashboard() {
initAIAssistant();
DOM.dashboardModal.style.display = 'block';
DOM.dashboardModal.setAttribute('aria-hidden', 'false');
if (DOM.dashboardBtn) DOM.dashboardBtn.setAttribute('aria-expanded', 'true');
Utils.trapFocus(DOM.dashboardModal);
DOM.body.style.overflow = 'hidden';
DOM.body.classList.add('modal-open');
Expand All @@ -759,6 +760,7 @@ function closeDashboard() {
if (!DOM.dashboardModal) return;
DOM.dashboardModal.style.display = "none";
DOM.dashboardModal.setAttribute("aria-hidden", "true");
if (DOM.dashboardBtn) DOM.dashboardBtn.setAttribute('aria-expanded', 'false');
DOM.body.style.overflow = "";
DOM.body.classList.remove("modal-open");
if (AppState.lastFocused) { AppState.lastFocused.focus(); AppState.lastFocused = null; }
Expand Down Expand Up @@ -1273,7 +1275,7 @@ function bindEvents() {
const key = e.key.toLowerCase();

// Handle Escape for input fields
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') {
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.isContentEditable) {
if (key === 'escape') {
e.target.blur();
if (e.target === DOM.search && DOM.searchSection && DOM.searchSection.classList.contains('active')) {
Expand Down Expand Up @@ -1332,6 +1334,17 @@ function bindEvents() {
toggleTheme();
}

// Dashboard toggle
if (key === 'd') {
if (DOM.dashboardModal) {
if (DOM.dashboardModal.style.display === 'block') {
closeDashboard();
} else {
openDashboard();
}
}
}

// Watch Later toggle
if (key === 'b') {
if (AppState.current) {
Expand Down
Loading