Commit 57bafac0 authored by Pierre M's avatar Pierre M
Browse files

remove redundancy from UI


Signed-off-by: Pierre M's avatarPierre Mazière <pierre.maziere@gmx.com>
parent 38c38c7b
......@@ -63,7 +63,7 @@
GM_addStyle(".overlaybg{position:fixed;top:0;left:0;width: 100%;height: 100%;background-color:#000; opacity:0.5;z-index:100}");
GM_addStyle(".overlaywin{position:fixed;left:0;right:0;top:0;bottom:0;width:600px;height:480px;margin:auto;background-color:#FFF;z-index:101;padding:10px 20px;border:thick double #000}");
GM_addStyle("#plonkList{position:relative;padding-top:25px;background:gray}");
GM_addStyle("#plonkList>div{overflow-y:auto;height:160px;background:#ddd}");
GM_addStyle("#plonkList>div{overflow-y:auto;height:190px;background:#ddd}");
GM_addStyle("#plonkList table{width:100%;border-collapse:collapse}");
GM_addStyle("#plonkList td, #plonkForm th{color:#000;text-align:center;border:1px;white-space:nowrap;padding:5px 25px;}");
GM_addStyle("#plonkList th{height:0;line-height:0;padding-top:0;padding-bottom:0;border:none;color:transparent;white-space:nowrap}");
......@@ -138,7 +138,7 @@
}
button.addEventListener("click",plonk.bind(null,user,alias),true);
let p = document.createElement("p");
let container = document.createElement("div");
container.setAttribute("id","plonkList");
let list = document.createElement("div");
......@@ -182,9 +182,10 @@
let tbody = document.createElement("tbody");
table.appendChild(tbody);
if(Object.keys(plonkList).length){
p.appendChild(
document.createTextNode("Liste des utilisateurs plonkés:")
);
form.appendChild(button);
if(plonkList.hasOwnProperty(user)){
button.style.visibility = "hidden";
}
for(let u in plonkList){
row = document.createElement("tr");
row.setAttribute("id",u);
......@@ -234,18 +235,15 @@
tbody.appendChild(row);
}
}else{
let p = document.createElement("p");
p.appendChild(
document.createTextNode("Aucun utilisateur actif plonké pour le moment.")
);
form.appendChild(p);
form.appendChild(button);
container.remove();
container = null;
}
form.appendChild(p);
form.appendChild(button);
if(plonkList.hasOwnProperty(user)){
button.style.visibility="hidden";
}
if(container){
form.appendChild(container);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment