From 64a8529f65be73dab1d3bef588f582fdfe136f64 Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Wed, 15 Dec 2021 23:55:06 -0800 Subject: [PATCH] context menu can now be closed with right click, fixed css error on #app-content --- resources/cider-ui/index.js | 9 ++++++--- resources/cider-ui/style.less | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/cider-ui/index.js b/resources/cider-ui/index.js index f0178676..61824680 100644 --- a/resources/cider-ui/index.js +++ b/resources/cider-ui/index.js @@ -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); diff --git a/resources/cider-ui/style.less b/resources/cider-ui/style.less index 1fc424d8..ac19a218 100644 --- a/resources/cider-ui/style.less +++ b/resources/cider-ui/style.less @@ -210,7 +210,7 @@ input[type=range].web-slider::-webkit-slider-runnable-track { overflow-y: scroll; overflow-y: overlay; overflow-x: hidden; - border-radius: 10px 0px; + border-radius: 10px 0px 0px 0px; border-left: 1px solid rgb(0 0 0 / 25%); border-top: 1px solid rgb(0 0 0 / 25%); position: relative;