MediaWiki:Minerva.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 3: Line 3:
// Template:TLP drawer
// Template:TLP drawer


function TLPExpand(w) {
function TLPExpand(x) {
   var t = "tlp-children-".concat(w);
   var y = "tlp-children-".concat(x); //kinda "tlp-children-1.21"
   var x = document.getElementById(t);
   var z = document.getElementById(y); //kinda document.getElementById("tlp-children-1.21")
   var y = "tlp-button-text-".concat(w);
   var a = "tlp-button-text-".concat(x); //kinda "tlp-button-text-1.21"
   var z = document.getElementById(x);
   var b = document.getElementById(x); //kinda document.getElementById("tlp-button-text-1.21")
   if (x.style.display === "block") {
   if (z.style.display === "block") {
     x.style.display = "none";
     z.style.display = "none";
     z.innerHTML = "Expand";
     b.innerHTML = "Expand";
   } else {
   } else {
     x.style.display = "block";
     z.style.display = "block";
     z.innerHTML = "Collapse";
     b.innerHTML = "Collapse";
   }
   }
}
}