Skip to content
Snippets Groups Projects
Commit 6bd43a13 authored by Silvio Giebl's avatar Silvio Giebl
Browse files

Fixed js browser incompatibility

(cherry picked from commit d39b7b3041d1bdb9f80ab7f5878e64a3b3b79b5d)
parent 8e6e3ddd
No related branches found
No related tags found
No related merge requests found
...@@ -25,10 +25,13 @@ jtd.onReady = function(ready) { ...@@ -25,10 +25,13 @@ jtd.onReady = function(ready) {
function initNav() { function initNav() {
jtd.addEvent(document, 'click', function(e){ jtd.addEvent(document, 'click', function(e){
var expander = e.path.find(function(x){ return x.classList && x.classList.contains('nav-list-expander') }); var target = e.target;
if (expander) { while (target && target.classList && !target.classList.contains('nav-list-expander')) {
target = target.parentElement;
}
if (target) {
e.preventDefault(); e.preventDefault();
expander.parentElement.classList.toggle('active'); target.parentElement.classList.toggle('active');
} }
}); });
......
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