2017-10-24 11:23:31 +00:00
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
|
|
|
const rootEl = document.documentElement;
|
|
|
|
const navbarTopEl = document.getElementById('navbar');
|
|
|
|
const navbarBottomEl = document.getElementById('navbarBottom');
|
|
|
|
const fixBottomEl = document.getElementById('navbarFixBottom');
|
|
|
|
const fixBottomElIcon = fixBottomEl.querySelector('.fa');
|
|
|
|
let fixedBottom = false;
|
|
|
|
|
|
|
|
fixBottomEl.addEventListener('click', event => {
|
|
|
|
fixedBottom = !fixedBottom;
|
|
|
|
|
|
|
|
if (fixedBottom) {
|
|
|
|
fixBottomEl.className = 'button is-success';
|
2018-01-10 16:30:23 +00:00
|
|
|
fixBottomElIcon.className = 'far fa-check-square';
|
2017-10-24 11:23:31 +00:00
|
|
|
rootEl.classList.add('has-navbar-fixed-bottom');
|
|
|
|
navbarBottomEl.classList.remove('is-hidden');
|
|
|
|
} else {
|
|
|
|
fixBottomEl.className = 'button is-link';
|
2018-01-10 16:30:23 +00:00
|
|
|
fixBottomElIcon.className = 'far fa-square';
|
2017-10-24 11:23:31 +00:00
|
|
|
rootEl.classList.remove('has-navbar-fixed-bottom');
|
|
|
|
navbarBottomEl.classList.add('is-hidden');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|