context menu can now be closed with right click, fixed css error on #app-content
This commit is contained in:
parent
98d697b211
commit
64a8529f65
2 changed files with 7 additions and 4 deletions
|
@ -32,15 +32,18 @@ var CiderContextMenu = {
|
|||
menu.classList.remove("context-menu-open");
|
||||
}, {once: true});
|
||||
|
||||
// when menubackground is clicked, remove it
|
||||
menuBackground.addEventListener("click", function () {
|
||||
function close () {
|
||||
menuBackground.style.pointerEvents = "none";
|
||||
menu.classList.add("context-menu-close");
|
||||
menu.addEventListener("animationend", function () {
|
||||
menuBackground.remove();
|
||||
menu.remove();
|
||||
}, {once: true});
|
||||
});
|
||||
}
|
||||
|
||||
// when menubackground is clicked, remove it
|
||||
menuBackground.addEventListener("click", close);
|
||||
menuBackground.addEventListener("contextmenu", close);
|
||||
|
||||
// add menu to menuBackground
|
||||
menuBackground.appendChild(menu);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue