From 47cb585e2d05e252d718adeb8a6c13e15076e655 Mon Sep 17 00:00:00 2001 From: dnahol Date: Tue, 22 Oct 2019 14:31:17 -0700 Subject: [PATCH] identities list in container panel is now tabbable and buttons are accessible via enter key --- src/js/popup.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/popup.js b/src/js/popup.js index e5b4dbf..2c2b2c1 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -639,6 +639,7 @@ Logic.registerPanel(P_CONTAINERS_LIST, { manage.classList.add("show-tabs", "pop-button"); manage.setAttribute("title", `View ${identity.name} container`); context.setAttribute("tabindex", "0"); + manage.setAttribute("tabindex", "0"); context.setAttribute("title", `Create ${identity.name} tab`); context.innerHTML = escaped`
@@ -660,7 +661,10 @@ Logic.registerPanel(P_CONTAINERS_LIST, { } Logic.addEnterHandler(tr, async (e) => { - if (e.target.matches(".open-newtab") + if (e.target.matches(".show-tabs") && hasTabs) { + Logic.showPanel(P_CONTAINER_INFO, identity); + } + else if (e.target.matches(".open-newtab") || e.target.parentNode.matches(".open-newtab") || e.type === "keydown") { try { @@ -671,8 +675,6 @@ Logic.registerPanel(P_CONTAINERS_LIST, { } catch (e) { window.close(); } - } else if (hasTabs) { - Logic.showPanel(P_CONTAINER_INFO, identity); } }); }); @@ -1154,4 +1156,4 @@ window.addEventListener("resize", function () { root.style.setProperty("--overflow-size", difference + "px"); root.style.setProperty("--icon-fit", "12"); } -}); \ No newline at end of file +});