1
0
mirror of https://github.com/bitwarden/help synced 2025-12-06 00:03:30 +00:00

header permalinks

This commit is contained in:
Kyle Spearrin
2017-05-24 00:02:49 -04:00
parent 3afb2abc71
commit 1e42ae0d34
3 changed files with 41 additions and 1 deletions

View File

@@ -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;

View File

@@ -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>

View File

@@ -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'] {