mirror of
https://github.com/thangisme/notes.git
synced 2025-01-03 10:56:36 -05:00
Fixed js browser incompatibility
(cherry picked from commit d39b7b3041d1bdb9f80ab7f5878e64a3b3b79b5d)
This commit is contained in:
parent
8e6e3dddd3
commit
6bd43a1332
@ -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');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user