simplifying the solution

This commit is contained in:
shivangikakkar 2018-10-21 17:12:56 +05:30
parent 752d18ffca
commit dcc3b76cda
2 changed files with 4 additions and 4 deletions

View file

@ -506,8 +506,8 @@ Logic.registerPanel(P_CONTAINERS_LIST, {
Logic.showPanel(P_CONTAINER_EDIT, { name: Logic.generateIdentityName() }); Logic.showPanel(P_CONTAINER_EDIT, { name: Logic.generateIdentityName() });
}); });
Logic.addEnterHandler(document.querySelector("#edit-containers-link"), () => { Logic.addEnterHandler(document.querySelector("#edit-containers-link"), (e) => {
if (!document.querySelector("#edit-containers").classList.contains("disable-edit-containers")){ if (!e.target.classList.contains("disable-edit-containers")){
Logic.showPanel(P_CONTAINERS_EDIT); Logic.showPanel(P_CONTAINERS_EDIT);
} }
}); });
@ -690,7 +690,7 @@ Logic.registerPanel(P_CONTAINERS_LIST, {
document.removeEventListener("focus", focusHandler); document.removeEventListener("focus", focusHandler);
}); });
/* If no container is present disable the Edit Containers button */ /* If no container is present disable the Edit Containers button */
const editContainer = document.querySelector("#edit-containers"); const editContainer = document.querySelector("#edit-containers-link");
if (Logic.identities().length === 0) { if (Logic.identities().length === 0) {
editContainer.classList.add("disable-edit-containers"); editContainer.classList.add("disable-edit-containers");
} else { } else {

View file

@ -116,7 +116,7 @@
</table> </table>
</div> </div>
<div class="panel-footer edit-identities"> <div class="panel-footer edit-identities">
<div class="edit-containers-text panel-footer-secondary" id="edit-containers"> <div class="edit-containers-text panel-footer-secondary">
<a href="#" tabindex="0" id="edit-containers-link">Edit Containers</a> <a href="#" tabindex="0" id="edit-containers-link">Edit Containers</a>
</div> </div>
<a href="#" tabindex="0" class="add-container-link pop-button" id="container-add-link" title="Create new container"> <a href="#" tabindex="0" class="add-container-link pop-button" id="container-add-link" title="Create new container">