assets/scripts/main.js in wai-website-theme-1.2 vs assets/scripts/main.js in wai-website-theme-1.3
- old
+ new
@@ -26,16 +26,23 @@
return (el && el.offsetWidth > 0 && el.offsetHeight > 0);
};
/* Showhidebutton */
- var showhidebuttons = document.querySelectorAll('.showhidebutton');
-
+ const showhidebuttons = document.querySelectorAll('.showhidebutton');
+ const mq = window.matchMedia( "(min-width: 47.5em)" );
if (showhidebuttons !== null) {
-
Array.prototype.forEach.call(showhidebuttons, function(button, i){
var buttontarget = button.dataset.target;
var bid = button.dataset.showhidebuttonid;
+ if (button.getAttribute('data-large-aria-expanded') && mq.matches) {
+ if (button.getAttribute('data-large-aria-expanded') == "true") {
+ button.setAttribute('aria-expanded', 'true');
+ }
+ if (button.getAttribute('data-large-aria-expanded') == "false") {
+ button.setAttribute('aria-expanded', 'false');
+ }
+ }
Array.prototype.forEach.call(document.querySelectorAll(buttontarget), function(el, i){
if(button.getAttribute('aria-expanded') == "true") {
el.removeAttribute('hidden');
button.innerHTML = button.dataset.hidetext;
} else {
\ No newline at end of file