removed unecessary elements

This commit is contained in:
triptishukla 2019-10-30 09:57:17 +05:30
parent 73bc74d47f
commit 854cc7c1a0

View file

@ -615,8 +615,6 @@ Logic.registerPanel(P_CONTAINERS_LIST, {
currentPage.prepend(favIconElement); currentPage.prepend(favIconElement);
const currentContainer = document.getElementById("current-container"); const currentContainer = document.getElementById("current-container");
const DefaultText =document.getElementById("default-text");
const DefaultBox =document.getElementById("container-page-assigned");
currentContainer.innerText = identity.name; currentContainer.innerText = identity.name;
if (identity.name === "Default"){ if (identity.name === "Default"){
document.getElementById("container-page-assigned-label").style.display = "none"; document.getElementById("container-page-assigned-label").style.display = "none";
@ -894,8 +892,7 @@ Logic.registerPanel(P_CONTAINERS_EDIT, {
tr.querySelector(".container-name").textContent = identity.name; tr.querySelector(".container-name").textContent = identity.name;
tr.querySelector(".edit-container").setAttribute("title", `Edit ${identity.name} container`); tr.querySelector(".edit-container").setAttribute("title", `Edit ${identity.name} container`);
tr.querySelector(".remove-container").setAttribute("title", `Remove ${identity.name} container`); tr.querySelector(".remove-container").setAttribute("title", `Remove ${identity.name} container`);
tr.setAttribute("tabindex","0");
Logic.addEnterHandler(tr, e => { Logic.addEnterHandler(tr, e => {
if (e.target.matches(".edit-container-icon") || e.target.parentNode.matches(".edit-container-icon")) { if (e.target.matches(".edit-container-icon") || e.target.parentNode.matches(".edit-container-icon")) {
Logic.showPanel(P_CONTAINER_EDIT, identity); Logic.showPanel(P_CONTAINER_EDIT, identity);
@ -909,45 +906,8 @@ Logic.registerPanel(P_CONTAINERS_EDIT, {
list.innerHTML = ""; list.innerHTML = "";
list.appendChild(fragment); list.appendChild(fragment);
list.addEventListener("keydown", (e) => {
console.log("hi");
const selectables = [...document.querySelectorAll("[tabindex='0'], [tabindex='-1']")];
console.log(selectables[0].innerHTML);
const element = document.activeElement;
const index = selectables.indexOf(element) || 0;
function next() {
const nextElement = selectables[index + 1];
if (nextElement) {
nextElement.focus();
}
}
function previous() {
const previousElement = selectables[index - 1];
if (previousElement) {
previousElement.focus();
}
}
switch (e.keyCode) {
case 40:
next();
break;
case 38:
previous();
break;
default:
if ((e.keyCode >= 49 && e.keyCode <= 57) &&
Logic._currentPanel === "containersEdit") {
const element = selectables[e.keyCode - 48];
if (element) {
element.click();
}
}
break;
}
});
return Promise.resolve(null); return Promise.resolve(null);
}, },
}); });
// P_CONTAINER_EDIT: Editor for a container. // P_CONTAINER_EDIT: Editor for a container.
@ -1081,7 +1041,7 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
templateInstance.innerHTML = iconRadioTemplate(containerIcon); templateInstance.innerHTML = iconRadioTemplate(containerIcon);
iconRadioFieldset.appendChild(templateInstance); iconRadioFieldset.appendChild(templateInstance);
}); });
}, },P_CONTAINERS_EDIT
// This method is called when the panel is shown. // This method is called when the panel is shown.
async prepare() { async prepare() {