mirror of
https://github.com/jgthms/bulma.git
synced 2024-11-28 12:24:23 +00:00
27 lines
952 B
JavaScript
27 lines
952 B
JavaScript
'use strict';
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
var rootEl = document.documentElement;
|
|
var navbarTopEl = document.getElementById('navbar');
|
|
var navbarBottomEl = document.getElementById('navbarBottom');
|
|
var fixBottomEl = document.getElementById('navbarFixBottom');
|
|
var fixBottomElIcon = fixBottomEl.querySelector('.fa');
|
|
var fixedBottom = false;
|
|
|
|
fixBottomEl.addEventListener('click', function (event) {
|
|
fixedBottom = !fixedBottom;
|
|
|
|
if (fixedBottom) {
|
|
fixBottomEl.className = 'button is-success';
|
|
fixBottomElIcon.className = 'fa fa-check-square-o';
|
|
rootEl.classList.add('has-navbar-fixed-bottom');
|
|
navbarBottomEl.classList.remove('is-hidden');
|
|
} else {
|
|
fixBottomEl.className = 'button is-link';
|
|
fixBottomElIcon.className = 'fa fa-square-o';
|
|
rootEl.classList.remove('has-navbar-fixed-bottom');
|
|
navbarBottomEl.classList.add('is-hidden');
|
|
}
|
|
});
|
|
}); |