Suppression de la flêche pour remonter en haut de la page
This commit is contained in:
parent
3e173c0e7b
commit
82e06133b3
8 changed files with 28 additions and 53 deletions
|
@ -1,22 +0,0 @@
|
|||
(function() {
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
const targetElements = document.querySelector('main').querySelectorAll('h1, h2, h3, h4, h5, h6');
|
||||
|
||||
targetElements.forEach(( el ) => {
|
||||
if (el.id) {
|
||||
const headerlink = document.createElement('a');
|
||||
headerlink.setAttribute('class', 'headerlink');
|
||||
headerlink.setAttribute('href', '#' + el.id);
|
||||
headerlink.setAttribute('title', 'Permalink to this headline');
|
||||
|
||||
const icon = document.createElement('i');
|
||||
icon.setAttribute('class', 'fas fa-hashtag');
|
||||
icon.setAttribute('aria-hidden', 'true');
|
||||
|
||||
headerlink.append(icon);
|
||||
|
||||
el.append(headerlink);
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
|
@ -1,18 +0,0 @@
|
|||
(function() {
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
const nav_prev = document.querySelector('.nav-prev');
|
||||
const nav_next = document.querySelector('.nav-next');
|
||||
|
||||
// prev links - left arrow key
|
||||
document.addEventListener( 'keydown', event => {
|
||||
if (nav_prev && event.key === 'ArrowLeft') {
|
||||
location.href = nav_prev.getAttribute('href');
|
||||
}
|
||||
|
||||
// next links - right arrow key
|
||||
if (nav_next && event.key === 'ArrowRight') {
|
||||
location.href = nav_next.getAttribute('href');
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
|
@ -1,4 +1,2 @@
|
|||
require( './sidebar-menu.js' );
|
||||
require( './keydown-nav.js' );
|
||||
require( './headerlink.js' );
|
||||
require( './code.js' );
|
||||
|
|
|
@ -200,10 +200,6 @@ figure > figcaption {
|
|||
background: variable.$sidebar-active-color;
|
||||
}
|
||||
|
||||
.backtothetop {
|
||||
display: none;
|
||||
font-size: 200%;
|
||||
}
|
||||
.fa-layers .fa-circle {
|
||||
color: #fff;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue