MediaWiki

Common.js: Difference between revisions

From Redrock Wiki

No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
Line 12: Line 12:
         this.innerHTML = this.innerHTML.replace('-down', '-up');
         this.innerHTML = this.innerHTML.replace('-down', '-up');
       } else {
       } else {
         content.style.display = "inline !important";
         content.style.display = "inline";
         this.innerHTML = this.innerHTML.replace('-up', '-down');
         this.innerHTML = this.innerHTML.replace('-up', '-down');
       }
       }

Revision as of 18:15, 9 April 2026

/* Any JavaScript here will be loaded for all users on every page load. */

/* collapsible categories */
$(function () {
  var coll = document.getElementsByClassName("collapsibleList");

  for (var i = 0; i < coll.length; i++) {
    coll[i].addEventListener("click", function () {
      var content = this.nextElementSibling
      if (content.style.display === "inline") {
        content.style.display = "none";
        this.innerHTML = this.innerHTML.replace('-down', '-up');
      } else {
        content.style.display = "inline";
        this.innerHTML = this.innerHTML.replace('-up', '-down');
      }
    });
  }
});