From 63ece664526fbf98fe44371e9e41f1afcd26b710 Mon Sep 17 00:00:00 2001 From: Sybille Peters Date: Mon, 24 Jun 2024 12:41:29 +0200 Subject: [PATCH] [BUGFIX] Fix reading aria-expanded attribute Depending on brower version, the value of the aria-expanded attribute could sometimes not be read correctly. This resulted in elements always being collapsed. Resolves: #11 --- Resources/Public/JavaScript/PageModuleCollapse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Public/JavaScript/PageModuleCollapse.js b/Resources/Public/JavaScript/PageModuleCollapse.js index d434cbb..46affa5 100644 --- a/Resources/Public/JavaScript/PageModuleCollapse.js +++ b/Resources/Public/JavaScript/PageModuleCollapse.js @@ -24,7 +24,7 @@ define([ // Update the correct status as we are unable to modify the templates document.querySelector(btn.dataset.bsTarget).classList.add('collapse'); - if (btn.ariaExpanded == 'true') { + if (btn.getAttribute('aria-expanded') == 'true') { document.querySelector(btn.dataset.bsTarget).classList.add('show'); substituteNode.classList.add('d-none'); }