From ec14dba649796c27f71a9ab91c0920ecc1eb03fe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 09:12:21 +0000 Subject: [PATCH] fix: allow tab-menu-dropdown to open on non-active tabs Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/6f843c1b-8417-45ef-a03b-28de6cec7c0e Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com> --- desktop-app/resources/js/script.js | 6 ++++-- script.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/desktop-app/resources/js/script.js b/desktop-app/resources/js/script.js index c90154a..92adbfb 100644 --- a/desktop-app/resources/js/script.js +++ b/desktop-app/resources/js/script.js @@ -582,7 +582,8 @@ This is a fully client-side application. Your content never leaves your browser item.appendChild(titleSpan); item.appendChild(menuBtn); - item.addEventListener('click', function() { + item.addEventListener('click', function(e) { + if (e.target.closest('.tab-menu-btn')) return; switchTab(tab.id); }); @@ -706,7 +707,8 @@ This is a fully client-side application. Your content never leaves your browser item.appendChild(titleSpan); item.appendChild(menuBtn); - item.addEventListener('click', function() { + item.addEventListener('click', function(e) { + if (e.target.closest('.tab-menu-btn')) return; switchTab(tab.id); closeMobileMenu(); }); diff --git a/script.js b/script.js index c90154a..92adbfb 100644 --- a/script.js +++ b/script.js @@ -582,7 +582,8 @@ This is a fully client-side application. Your content never leaves your browser item.appendChild(titleSpan); item.appendChild(menuBtn); - item.addEventListener('click', function() { + item.addEventListener('click', function(e) { + if (e.target.closest('.tab-menu-btn')) return; switchTab(tab.id); }); @@ -706,7 +707,8 @@ This is a fully client-side application. Your content never leaves your browser item.appendChild(titleSpan); item.appendChild(menuBtn); - item.addEventListener('click', function() { + item.addEventListener('click', function(e) { + if (e.target.closest('.tab-menu-btn')) return; switchTab(tab.id); closeMobileMenu(); });