RIP Webby

Weboasis => Bug Reports => Topic started by: Admin on January 22, 2022, 01:52:57 am

Title: [FAQ] Broken Expand All Button
Post by: Admin on January 22, 2022, 01:52:57 am
Since the last rewrite of the /faq page, the function "listExpansion()" used by the Expand button is no longer in /faq/faq.min.js (https://weboas.is/faq/faq.min.js).

Here is a quick-and-dirty implementation of the old functionality:
Code: [Select] (#post_)window.listExpansion = function() {
  var c = document.getElementById("expand");
  var b = document.getElementsByClassName("toggleAnswer");
  for (var i = 0; i < b.length; i++) {
    'Expand' === c.innerHTML.trim() ? b.style.display = 'block' : b.style.display = 'none';
  }
  c.innerHTML.trim() == "Expand" ? c.innerHTML = "Collapse" : c.innerHTML = "Expand";
}

For toggling, replace the line in the for loop with this:
Code: [Select] (#post_)'block' === b.style.display ? b.style.display = 'none' : b.style.display = 'block';

                  
Title: Re: [FAQ] Broken Expand All Button
Post by: Admin on January 22, 2022, 01:53:09 am
Yea, I noticed it late last night too. I will have it fixed soon :-) thanks!
                  
Title: Re: [FAQ] Broken Expand All Button
Post by: Admin on January 22, 2022, 01:53:21 am
This is now fixed.