Parcourir la source

navigation: new tab with right click

Jost Schmithals il y a 8 ans
Parent
commit
b3a8ec781d
2 fichiers modifiés avec 6 ajouts et 9 suppressions
  1. 1 8
      docs/index.css
  2. 5 1
      docs/index.html

+ 1 - 8
docs/index.css

@@ -50,18 +50,11 @@ h3 {
     margin-left: 20px;
 }
 
-a, li span {
-    color: #2194CE;
-}
-
 a {
+    color: #2194CE;
     text-decoration: none;
 }
 
-li span {
-    cursor: pointer;
-}
-
 #panel {
     position: fixed;
     left: 0px;

+ 5 - 1
docs/index.html

@@ -125,7 +125,11 @@
                         var pageURL = pages[ pageName ];
 
                         var listElement = createAndAppendDOMElement( { type: 'li', parent: categoryContent } );
-                        var linkElement = createAndAppendDOMElement( { type: 'span', parent: listElement, content: pageName } );
+                        var linkElement = createAndAppendDOMElement( { type: 'a', parent: listElement, content: pageName } );
+
+                        // The href attribute is only used for the option to create a new tab by right click
+
+                        linkElement.setAttribute( 'href', '#' + pageURL );
 
                         addClickHandlers( linkElement, pageURL );