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 TLPExpandDe(x) {
function TLPExpandDe(x) {
   var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21"
   var content = document.getElementById('tlp-children-'+x); //outputs something like document.getElementById("tlp-children-1.21")
  var z = document.getElementById(y); //outputs something like document.getElementById("tlp-children-1.21")
   var button = document.getElementById('tlp-button-text-'+x); //outputs something like document.getElementById("tlp-button-text-1.21")
   var a = "tlp-button-text-".concat(x); //outputs something like "tlp-button-text-1.21"
   if (content.style.display == "block") {
  var b = document.getElementById(a); //outputs something like document.getElementById("tlp-button-text-1.21")
     content.style.display = "none";
   if (z.style.display === "block") {
     button.innerHTML = "Ausklappen";
     z.style.display = "none";
     b.innerHTML = "Ausklappen";
   } else {
   } else {
     z.style.display = "block";
     content.style.display = "block";
     b.innerHTML = "Einklappen";
     button.innerHTML = "Einklappen";
   }
   }
}
}