Add heading

This commit is contained in:
Jeremy Thomas
2017-07-29 13:02:00 +01:00
parent 741e9d2d40
commit 93b7fb2fd4
47 changed files with 352 additions and 223 deletions

View File

@@ -4,6 +4,23 @@ document.addEventListener('DOMContentLoaded', function () {
// Dropdowns
var $metalinks = getAll('#meta a');
if ($metalinks.length > 0) {
$metalinks.forEach(function ($el) {
$el.addEventListener('click', function (event) {
event.preventDefault();
var target = $el.getAttribute('href');
var $target = document.getElementById(target.substring(1));
$target.scrollIntoView(true);
window.history.replaceState(null, document.title, '' + window.location.origin + window.location.pathname + target);
return false;
});
});
}
// Dropdowns
var $dropdowns = getAll('.dropdown:not(.is-hoverable)');
if ($dropdowns.length > 0) {