Skip to content

Commit ec14dba

Browse files
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>
1 parent 444d6a1 commit ec14dba

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

desktop-app/resources/js/script.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,8 @@ This is a fully client-side application. Your content never leaves your browser
582582
item.appendChild(titleSpan);
583583
item.appendChild(menuBtn);
584584

585-
item.addEventListener('click', function() {
585+
item.addEventListener('click', function(e) {
586+
if (e.target.closest('.tab-menu-btn')) return;
586587
switchTab(tab.id);
587588
});
588589

@@ -706,7 +707,8 @@ This is a fully client-side application. Your content never leaves your browser
706707
item.appendChild(titleSpan);
707708
item.appendChild(menuBtn);
708709

709-
item.addEventListener('click', function() {
710+
item.addEventListener('click', function(e) {
711+
if (e.target.closest('.tab-menu-btn')) return;
710712
switchTab(tab.id);
711713
closeMobileMenu();
712714
});

script.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,8 @@ This is a fully client-side application. Your content never leaves your browser
582582
item.appendChild(titleSpan);
583583
item.appendChild(menuBtn);
584584

585-
item.addEventListener('click', function() {
585+
item.addEventListener('click', function(e) {
586+
if (e.target.closest('.tab-menu-btn')) return;
586587
switchTab(tab.id);
587588
});
588589

@@ -706,7 +707,8 @@ This is a fully client-side application. Your content never leaves your browser
706707
item.appendChild(titleSpan);
707708
item.appendChild(menuBtn);
708709

709-
item.addEventListener('click', function() {
710+
item.addEventListener('click', function(e) {
711+
if (e.target.closest('.tab-menu-btn')) return;
710712
switchTab(tab.id);
711713
closeMobileMenu();
712714
});

0 commit comments

Comments
 (0)