added click on a on text fire the click on nav links

This commit is contained in:
Bachir Soussi Chiadmi
2017-07-18 20:50:43 +02:00
parent 5963e8d352
commit 9b043383a8
3 changed files with 25 additions and 1 deletions
+12
View File
@@ -3235,6 +3235,8 @@ var _Dot = {
oninit: function(vn){
this.id = vn.attrs.id;
this.type = vn.attrs.type;
// construct text
this.text = markdown.render(vn.attrs.text);
// construct summary
@@ -3309,6 +3311,16 @@ var _Dot = {
link.classList.remove('highlight');
}
}
},
onclick:function(e){
e.preventDefault();
if(e.target.nodeName == "A" ){
// console.log("over e.target", e.target);
// console.log('over vn', vn);
var id = e.target.getAttribute("href");
// add highlight class
vn.dom.querySelector('nav.links>div[uid="'+id+'"]>.summary').click();
}
}
}, m.trust(this.text)),
// links from
+1 -1
View File
File diff suppressed because one or more lines are too long
+12
View File
@@ -28,6 +28,8 @@ var _Dot = {
oninit: function(vn){
this.id = vn.attrs.id;
this.type = vn.attrs.type;
// construct text
this.text = markdown.render(vn.attrs.text);
// construct summary
@@ -102,6 +104,16 @@ var _Dot = {
link.classList.remove('highlight');
}
}
},
onclick:function(e){
e.preventDefault();
if(e.target.nodeName == "A" ){
// console.log("over e.target", e.target);
// console.log('over vn', vn);
var id = e.target.getAttribute("href");
// add highlight class
vn.dom.querySelector('nav.links>div[uid="'+id+'"]>.summary').click();
}
}
}, m.trust(this.text)),
// links from