mirror of
https://github.com/thangisme/notes.git
synced 2024-12-22 08:56:43 -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() {
|
||||
jtd.addEvent(document, 'click', function(e){
|
||||
var expander = e.path.find(function(x){ return x.classList && x.classList.contains('nav-list-expander') });
|
||||
if (expander) {
|
||||
var target = e.target;
|
||||
while (target && target.classList && !target.classList.contains('nav-list-expander')) {
|
||||
target = target.parentElement;
|
||||
}
|
||||
if (target) {
|
||||
e.preventDefault();
|
||||
expander.parentElement.classList.toggle('active');
|
||||
target.parentElement.classList.toggle('active');
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user