Skip to content
Snippets Groups Projects
Commit 8d5e2091 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Fix expander: forEach not supported by Office Webviewer

parent 9b1bc076
No related branches found
No related tags found
No related merge requests found
......@@ -53,10 +53,11 @@ ready(function () {
}
};
// Expander boxes
var expandable = document.querySelectorAll('.expandable > .expander');
expandable.forEach(function (currentValue, index, arr) {
currentValue.onclick = function (e) {
for (var i = 0; i < expandable.length; i++) {
expandable[i].currentValue.onclick = function (e) {
var parent = e.currentTarget.parentNode;
if (parent.className.match(/(?:^|\s)expanded(?!\S)/)) {
parent.className = parent.className.replace(/(?:^|\s)expanded(?!\S)/g , '');
......@@ -64,6 +65,6 @@ ready(function () {
parent.className += " expanded";
}
e.currentTarget.blur();
}
)};
};
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment