diff options
author | Hanzei <hanzei@mailbox.org> | 2018-07-29 10:21:19 +0300 |
---|---|---|
committer | Hanzei <hanzei@mailbox.org> | 2018-07-29 10:21:19 +0300 |
commit | ef4cd37814ed3acb0d7cedbcef6d28372624217a (patch) | |
tree | 1f1b90734eee45a1efbaf8bf5591b7de7c416c1e /assets/js | |
parent | 2689fddc64708cbb8750543bfa8b134957b24574 (diff) |
Use doublequotes when possible
Diffstat (limited to 'assets/js')
-rw-r--r-- | assets/js/index.js | 24 | ||||
-rw-r--r-- | assets/js/initMoment.js | 2 |
2 files changed, 13 insertions, 13 deletions
diff --git a/assets/js/index.js b/assets/js/index.js index 9f3fc27..68f26d3 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -1,27 +1,27 @@ // Nav burger animation -document.addEventListener('DOMContentLoaded', function () { +document.addEventListener("DOMContentLoaded", function () { // Get all "navbar-burger" elements - var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0); + var $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 () { + $el.addEventListener("click", function () { // Get the target from the "data-target" attribute var target = $el.dataset.target; var $target = document.getElementById(target); // Toggle the class on both the "navbar-burger" and the "navbar-menu" - $el.classList.toggle('is-active'); - $target.classList.toggle('is-active'); + $el.classList.toggle("is-active"); + $target.classList.toggle("is-active"); }); }); } }); // Bitty scrolling links script -$('a[href^="#"]').click(function(e) { +$("a[href^=\"#\"]").click(function(e) { e.preventDefault(); - $('html, body').animate({ + $("html, body").animate({ scrollTop: $(this.hash).offset().top }, 500); $("#nav-menu").removeClass("is-active"); @@ -29,17 +29,17 @@ $('a[href^="#"]').click(function(e) { }) // Modal closer -$('.card').click(function () { - $($(this).attr('data-target')).addClass('is-active'); +$(".card").click(function () { + $($(this).attr("data-target")).addClass("is-active"); $("html").addClass("modal-open"); }); -$('.modal-close').click(function () { - $($(this).attr('data-target')).removeClass('is-active'); +$(".modal-close").click(function () { + $($(this).attr("data-target")).removeClass("is-active"); $("html").removeClass("modal-open"); }); $(document).keypress(function(e) { if(e.which == 0) { - $('.modal.is-active').removeClass('is-active'); + $(".modal.is-active").removeClass("is-active"); $("html").removeClass("modal-open"); } }); diff --git a/assets/js/initMoment.js b/assets/js/initMoment.js index 20a0a4b..609f671 100644 --- a/assets/js/initMoment.js +++ b/assets/js/initMoment.js @@ -1,4 +1,4 @@ $(document).ready(function() { var time = moment().tz("{{ .Site.Params.home.timeZone }}").format("h:mm A"); - $('#time').html(time); + $("#time").html(time); }) |