mirror of https://github.com/docker/docs.git
Re-enable "anchorlink" script
This allows for easier sharing of links to specific sections on a page. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
b633d3c21c
commit
5276ea1d9f
|
@ -295,7 +295,7 @@
|
|||
hljs.initHighlightingOnLoad();
|
||||
</script>
|
||||
{% endif %}
|
||||
<!-- <script src="/js/anchorlinks.js"></script> -->
|
||||
<script defer src="/js/anchorlinks.js"></script>
|
||||
<script defer src="/js/menu.js"></script>
|
||||
<script src="/js/jquery.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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', '<a href="' + window.location.href + '#' + h.id + '" class="anchorLink">¶</a>')
|
||||
h.insertAdjacentHTML('beforeend', '<a href="' + window.location.href + '#' + h.id + '" class="anchorLink">🔗</a>')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue