MediaWiki:Minerva.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 74: Line 74:


function drawerExpand(x) {
function drawerExpand(x) {
   var y = "drawer-".concat(x); //outputs something like "drawer-1"
   var content = document.getElementById("drawer-content-"+x);
  var z = document.getElementById(y); //outputs something like document.getElementById("drawer-1")
   var button = document.getElementById("drawer-button-"+x);
  var a = "drawer-button-".concat(x); //outputs something like "drawer-button-1"
   if (content.style.display === "block") {
   var b = document.getElementById(a); //outputs something like document.getElementById("drawer-button-1")
     content.style.display = "none";
   if (z.style.display === "block") {
button.innerHTML = "Expand";
     z.style.display = "none";
b.innerHTML = "Expand";
   } else {
   } else {
     z.style.display = "block";
     content.style.display = "block";
     b.innerHTML = "Collapse";
     button.innerHTML = "Collapse";
   }
   }
}
}