From: Jeremy Thomas Date: Mon, 9 Jul 2018 15:03:16 +0000 (+0100) Subject: Fix docs X-Git-Tag: 0.7.2~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14daff89c097d479d1d377a154465b68fc30509a;p=thirdparty%2Fbulma.git Fix docs --- diff --git a/docs/documentation/components/navbar.html b/docs/documentation/components/navbar.html index 6b4e5b3c1..d3fe7a351 100644 --- a/docs/documentation/components/navbar.html +++ b/docs/documentation/components/navbar.html @@ -497,24 +497,24 @@ meta: {% endcapture %} {% capture navbar_js_code %} -document.addEventListener('DOMContentLoaded', function () { +document.addEventListener('DOMContentLoaded', () => { // Get all "navbar-burger" elements - var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0); + const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0); // Check if there are any navbar burgers if ($navbarBurgers.length > 0) { // Add a click event on each of them - $navbarBurgers.forEach(function ($el) { - $el.addEventListener('click', function () { + $navbarBurgers.forEach( el => { + el.addEventListener('click', () => { // Get the target from the "data-target" attribute - var target = $el.dataset.target; - var $target = document.getElementById(target); + const target = el.dataset.target; + const $target = document.getElementById(target); // Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu" - $el.classList.toggle('is-active'); + el.classList.toggle('is-active'); $target.classList.toggle('is-active'); }); @@ -709,15 +709,15 @@ $(document).ready(function() { {% highlight html %}{{ navbar_js_html }}{% endhighlight %} {% highlight javascript %}{{ navbar_js_code }}{% endhighlight %} - +

And here is another implementation example, which again toggles the class is-active on both the navbar-burger and the targeted navbar-menu, but this time in jQuery.

{% highlight javascript %}{{ navbar_jquery_code }}{% endhighlight %} - +

- Remeber, these are just implementation examples. The Bulma package does not come with any JavaScript. + Remember, these are just implementation examples. The Bulma package does not come with any JavaScript.