Skip to content

Commit d1375bd

Browse files
committed
Add script for Bulma Navbar Burger
1 parent 9573c52 commit d1375bd

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/bulma-stubs/app.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,32 @@ const app = new Vue({
2222
});
2323

2424

25-
require('./bulma-extensions');
26-
25+
// Bulma NavBar Burger Script
2726
document.addEventListener('DOMContentLoaded', function () {
2827
// Get all "navbar-burger" elements
2928
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
30-
29+
3130
// Check if there are any navbar burgers
3231
if ($navbarBurgers.length > 0) {
33-
32+
3433
// Add a click event on each of them
3534
$navbarBurgers.forEach(function ($el) {
3635
$el.addEventListener('click', function () {
37-
36+
3837
// Get the target from the "data-target" attribute
3938
let target = $el.dataset.target;
4039
let $target = document.getElementById(target);
41-
40+
4241
// Toggle the class on both the "navbar-burger" and the "navbar-menu"
4342
$el.classList.toggle('is-active');
4443
$target.classList.toggle('is-active');
45-
44+
4645
});
4746
});
4847
}
49-
48+
5049
});
50+
51+
52+
53+
require('./bulma-extensions');

0 commit comments

Comments
 (0)