compiled js changes

This commit is contained in:
MathMan05 2024-09-02 15:32:53 -05:00
parent 1183dc40ce
commit f8b80b65fe
2 changed files with 90 additions and 100 deletions

View file

@ -30,10 +30,11 @@ class Contextmenu {
makemenu(x, y, addinfo, other) {
const div = document.createElement("div");
div.classList.add("contextmenu", "flexttb");
let visibleButtons = 0;
for (const thing of this.buttons) {
if (!thing[3].bind(addinfo)(other)) {
if (!thing[3].bind(addinfo)(other))
continue;
}
visibleButtons++;
const intext = document.createElement("button");
intext.disabled = !thing[4].bind(addinfo)(other);
intext.classList.add("contextbutton");
@ -44,6 +45,8 @@ class Contextmenu {
}
div.appendChild(intext);
}
if (visibleButtons == 0)
return;
if (Contextmenu.currentmenu != "") {
Contextmenu.currentmenu.remove();
}