From 5276ea1d9fb377d3bf7def3a29569681c20fb306 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 13 Feb 2020 12:48:12 +0100 Subject: [PATCH] Re-enable "anchorlink" script This allows for easier sharing of links to specific sections on a page. Signed-off-by: Sebastiaan van Stijn --- _layouts/docs.html | 2 +- _scss/_content.scss | 8 ++++++++ js/anchorlinks.js | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/_layouts/docs.html b/_layouts/docs.html index 72c71e0fb6..0427db24df 100755 --- a/_layouts/docs.html +++ b/_layouts/docs.html @@ -295,7 +295,7 @@ hljs.initHighlightingOnLoad(); {% endif %} - + diff --git a/_scss/_content.scss b/_scss/_content.scss index c7b86b2c8f..d55f35385d 100755 --- a/_scss/_content.scss +++ b/_scss/_content.scss @@ -116,10 +116,18 @@ pre code { } a.anchorLink { + font-size: 0.5em; margin-left: 5px; visibility: hidden; } +h1:hover > a.anchorLink, +h2:hover > a.anchorLink, +h3:hover > a.anchorLink +{ + visibility: visible; +} + a.glossary { color: $body-text-color; text-decoration: none; diff --git a/js/anchorlinks.js b/js/anchorlinks.js index 8307fe68e3..878ef64001 100644 --- a/js/anchorlinks.js +++ b/js/anchorlinks.js @@ -1,11 +1,11 @@ (function(d) { "use strict"; - var hs = d.getElementById("DocumentationText").querySelectorAll("H1, H2, H3"), h; + var hs = d.querySelectorAll("H1, H2, H3"), h; for (var i = 0; i < hs.length; i++) { h = hs[i]; if (h.id != null && h.id.length > 0) { - h.insertAdjacentHTML('beforeend', '') + h.insertAdjacentHTML('beforeend', '🔗') } }