From ec226e8742e6d4700f984974b11c349c3e61dc60 Mon Sep 17 00:00:00 2001 From: dnahol Date: Thu, 24 Oct 2019 11:48:34 -0700 Subject: [PATCH] make container info panel buttons tabbable --- src/js/popup.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/js/popup.js b/src/js/popup.js index e5b4dbf..3ea8579 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -713,11 +713,14 @@ Logic.registerPanel(P_CONTAINER_INFO, { // This method is called when the object is registered. async initialize() { - Logic.addEnterHandler(document.querySelector("#close-container-info-panel"), () => { + const closeContEl = document.querySelector("#close-container-info-panel"); + closeContEl.setAttribute("tabindex", "0"); + Logic.addEnterHandler(closeContEl, () => { Logic.showPreviousPanel(); }); - - Logic.addEnterHandler(document.querySelector("#container-info-hideorshow"), async () => { + const hideContEl = document.querySelector("#container-info-hideorshow"); + hideContEl.setAttribute("tabindex", "0"); + Logic.addEnterHandler(hideContEl, async () => { const identity = Logic.currentIdentity(); try { browser.runtime.sendMessage({ @@ -741,6 +744,7 @@ Logic.registerPanel(P_CONTAINER_INFO, { throw new Error("Could not check for incompatible add-ons."); } const moveTabsEl = document.querySelector("#container-info-movetabs"); + moveTabsEl.setAttribute("tabindex","0"); const numTabs = await Logic.numTabs(); if (incompatible) { Logic._disableMoveTabs("Moving container tabs is incompatible with Pulse, PageShot, and SnoozeTabs."); @@ -807,6 +811,7 @@ Logic.registerPanel(P_CONTAINER_INFO, {
${tab.title}
`; tr.querySelector("td").appendChild(Utils.createFavIconElement(tab.favIconUrl)); + tr.setAttribute("tabindex", "0"); document.getElementById("container-info-table").appendChild(fragment); // On click, we activate this tab. But only if this tab is active. @@ -1154,4 +1159,4 @@ window.addEventListener("resize", function () { root.style.setProperty("--overflow-size", difference + "px"); root.style.setProperty("--icon-fit", "12"); } -}); \ No newline at end of file +});