]> git.0d.be Git - chloro.git/commitdiff
add anchor links on titles
authorFrédéric Péters <fpeters@0d.be>
Sun, 24 Jul 2022 14:03:52 +0000 (16:03 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 24 Jul 2022 14:03:52 +0000 (16:03 +0200)
chloro/phyll/static/js/chloro.js
chloro/rdio/static/css/style.scss

index 3fbcd069e2220089653872c01fedb713f91a5ec8..dd95885422dde9cb4b0e17bc33ace2519d15c71b 100644 (file)
@@ -24,7 +24,7 @@ function remove_auto_anchors() {
 }
 
 function auto_anchors() {
-  $('article div.textcell h1, article div.textcell h2, article div.textcell h3, article div.textcell h4').each(function(idx, elem) {
+  $('article h2, article h3, article h4').each(function(idx, elem) {
     var $elem = $(elem);
     if ($elem.attr('id')) return;
     if ($elem.find('.wiki-anchor').length) return;
index 313fd4b9bce19ea92d4cf4c6013cff4c5012fd5a..c022eceec2b0624fbd593d156db23c31b53c3de4 100644 (file)
@@ -321,3 +321,20 @@ input#image-upload, input#document-upload {
                }
        }
 }
+
+.wiki-anchor {
+       display: none;
+}
+
+article h2:hover {
+       .wiki-anchor {
+               display: inline-block;
+               box-shadow: none;
+               border: none;
+               opacity: 0.8;
+               padding-left: 0.5rem;
+               &:hover {
+                       opacity: 1;
+               }
+       }
+}