Browse Source

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

Bachir Soussi Chiadmi 6 years ago
parent
commit
9b043383a8
3 changed files with 24 additions and 0 deletions
  1. 12 0
      assets/dist/main.js
  2. 0 0
      assets/dist/main.js.map
  3. 12 0
      assets/modules/dots.js

+ 12 - 0
assets/dist/main.js

@@ -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

File diff suppressed because it is too large
+ 0 - 0
assets/dist/main.js.map


+ 12 - 0
assets/modules/dots.js

@@ -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

Some files were not shown because too many files changed in this diff