wiki.js 668 B

1234567891011121314
  1. window.addEventListener("load", function() {
  2. document.querySelector(".wiki-nav-button").addEventListener('click', function(event) {
  3. document.querySelector(".wiki-links").classList.toggle('nodisplay');
  4. event.target.text = event.target.text == "Expand Menu" ? "Collapse Menu" : "Expand Menu";
  5. }, false);
  6. var expanders = document.querySelectorAll(".wiki-dir-expander");
  7. for (i = 0; i < expanders.length; ++i) {
  8. expanders[i].addEventListener('click', function(event) {
  9. event.target.parentElement.nextSibling.nextSibling.classList.toggle("nodisplay");
  10. event.target.text = event.target.text == "+" ? "-" : "+";
  11. }, false);
  12. };
  13. }, false);