identities list in container panel is now tabbable and buttons are accessible via enter key

This commit is contained in:
dnahol 2019-10-22 14:31:17 -07:00
parent 27d51f89c7
commit 47cb585e2d

View file

@ -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`
<div class="userContext-icon-wrapper open-newtab">
@ -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);
}
});
});