mirror of
https://github.com/bitwarden/help
synced 2025-12-06 00:03:30 +00:00
header permalinks
This commit is contained in:
@@ -63,7 +63,7 @@ layout: default
|
||||
// Append Rating-Widget JavaScript library.
|
||||
var rw, s = d.getElementsByTagName(e)[0], id = "rw-js",
|
||||
l = d.location, ck = "Y" + t.getFullYear() +
|
||||
"M" + t.getMonth() + "D" + t.getDate(), p = l.protocol,
|
||||
"M" + t.getMonth() + "D" + t.getDate(), p = l.protocol,
|
||||
f = ((l.search.indexOf("DBG=") > -1) ? "" : ".min"),
|
||||
a = ("https:" == p ? "secure." + m + "js/" : "js." + m);
|
||||
if (d.getElementById(id)) return;
|
||||
|
||||
@@ -173,6 +173,21 @@
|
||||
$('a[rel="lightbox"]').trigger('close.fluidbox');
|
||||
}
|
||||
});
|
||||
|
||||
$('.article .panel-body > h2, .article .panel-body > h3').filter('[id]').each(function () {
|
||||
var header = $(this),
|
||||
headerID = header.attr('id'),
|
||||
anchorClass = 'header-link',
|
||||
anchorIcon = '<i class="fa fa-link" aria-hidden="true"></i>';
|
||||
|
||||
if (headerID) {
|
||||
header.append($('<a />')
|
||||
.addClass(anchorClass)
|
||||
.attr({ 'href': '#' + headerID, 'aria-hidden': 'true', title: 'Permalink' })
|
||||
.html(anchorIcon));
|
||||
}
|
||||
return this;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -323,6 +323,31 @@ footer {
|
||||
@extend .table-bordered;
|
||||
@extend .table-striped;
|
||||
}
|
||||
|
||||
.header-link {
|
||||
color: $text-muted;
|
||||
text-decoration: none !important;
|
||||
opacity: 0;
|
||||
margin-left: 5px;
|
||||
|
||||
@media (max-width: 767px) {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
h2:hover > .header-link,
|
||||
h3:hover > .header-link {
|
||||
opacity: .5;
|
||||
-webkit-transition: color .16s linear;
|
||||
transition: color .16s linear;
|
||||
}
|
||||
|
||||
h2:hover > .header-link:hover,
|
||||
h3:hover > .header-link:hover,
|
||||
h2:hover > .header-link:focus,
|
||||
h3:hover > .header-link:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
a[rel='lightbox'] {
|
||||
|
||||
Reference in New Issue
Block a user