get rid of table

This commit is contained in:
MathMan05 2024-08-17 18:38:23 -05:00
parent f4911cc3aa
commit 69714e47cc
3 changed files with 12 additions and 13 deletions

View file

@ -28,19 +28,17 @@ class Contextmenu {
return {}; return {};
} }
makemenu(x, y, addinfo, obj) { makemenu(x, y, addinfo, obj) {
const div = document.createElement("table"); const div = document.createElement("div");
div.classList.add("contextmenu"); div.classList.add("contextmenu", "flexttb");
for (const thing of this.buttons) { for (const thing of this.buttons) {
if (!thing[3](addinfo)) { if (!thing[3](addinfo)) {
continue; continue;
} }
const textb = document.createElement("tr");
const intext = document.createElement("button"); const intext = document.createElement("button");
intext.disabled = !thing[4](); intext.disabled = !thing[4]();
textb["button"] = intext; intext["button"] = intext;
intext.classList.add("contextbutton"); intext.classList.add("contextbutton");
intext.textContent = thing[0]; intext.textContent = thing[0];
textb.appendChild(intext);
console.log(thing); console.log(thing);
if (thing[5] === "button") { if (thing[5] === "button") {
intext.onclick = thing[1].bind(addinfo, obj); intext.onclick = thing[1].bind(addinfo, obj);
@ -48,7 +46,7 @@ class Contextmenu {
else if (thing[5] === "submenu") { else if (thing[5] === "submenu") {
intext.onclick = thing[1].bind(addinfo); intext.onclick = thing[1].bind(addinfo);
} }
div.appendChild(textb); div.appendChild(intext);
} }
if (Contextmenu.currentmenu != "") { if (Contextmenu.currentmenu != "") {
Contextmenu.currentmenu.remove(); Contextmenu.currentmenu.remove();

View file

@ -28,17 +28,15 @@ class Contextmenu{
return {}; return {};
} }
makemenu(x:number,y:number,addinfo:any,obj:HTMLElement){ makemenu(x:number,y:number,addinfo:any,obj:HTMLElement){
const div=document.createElement("table"); const div=document.createElement("div");
div.classList.add("contextmenu"); div.classList.add("contextmenu","flexttb");
for(const thing of this.buttons){ for(const thing of this.buttons){
if(!thing[3](addinfo)){continue;} if(!thing[3](addinfo)){continue;}
const textb=document.createElement("tr");
const intext=document.createElement("button") const intext=document.createElement("button")
intext.disabled=!thing[4](); intext.disabled=!thing[4]();
textb["button"]=intext; intext["button"]=intext;
intext.classList.add("contextbutton") intext.classList.add("contextbutton")
intext.textContent=thing[0] intext.textContent=thing[0]
textb.appendChild(intext)
console.log(thing) console.log(thing)
if(thing[5]==="button"){ if(thing[5]==="button"){
intext.onclick=thing[1].bind(addinfo,obj); intext.onclick=thing[1].bind(addinfo,obj);
@ -46,7 +44,7 @@ class Contextmenu{
intext.onclick=thing[1].bind(addinfo); intext.onclick=thing[1].bind(addinfo);
} }
div.appendChild(textb); div.appendChild(intext);
} }
if(Contextmenu.currentmenu!=""){ if(Contextmenu.currentmenu!=""){
Contextmenu.currentmenu.remove(); Contextmenu.currentmenu.remove();

View file

@ -134,7 +134,8 @@ samp {
font-size: .5cm; font-size: .5cm;
cursor: pointer; cursor: pointer;
border-width: 0px 0px .03in; border-width: 0px 0px .03in;
margin: .02in .05in; margin: .03in .05in;
margin-bottom: .05in;
} }
.contextbutton:active{ .contextbutton:active{
border-width: 0px; border-width: 0px;
@ -227,6 +228,8 @@ h2 {
position: absolute; position: absolute;
background-color: var(--profile-info-bg); background-color: var(--profile-info-bg);
border-radius: .05in; border-radius: .05in;
width: fit-content !important;
padding: .03in;
} }
#neunence { #neunence {