From 0bcdad596157bb821eb96cba3fba3dc2d428d002 Mon Sep 17 00:00:00 2001 From: David Miller Date: Mon, 29 Mar 2021 15:59:18 -0400 Subject: [PATCH] update code comments in scripts --- dist/js/scripts.js | 11 ++++++----- src/js/scripts.js | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dist/js/scripts.js b/dist/js/scripts.js index 3ebe199..e73cfb0 100644 --- a/dist/js/scripts.js +++ b/dist/js/scripts.js @@ -6,17 +6,17 @@ (function ($) { "use strict"; // Start of use strict - // Smooth scrolling using jQuery easing + // Smooth scrolling using anime.js $('a.js-scroll-trigger[href*="#"]:not([href="#"])').on('click', function () { if ( location.pathname.replace(/^\//, "") == - this.pathname.replace(/^\//, "") && + this.pathname.replace(/^\//, "") && location.hostname == this.hostname ) { var target = $(this.hash); - target = target.length - ? target - : $("[name=" + this.hash.slice(1) + "]"); + target = target.length ? + target : + $("[name=" + this.hash.slice(1) + "]"); if (target.length) { anime({ targets: 'html, body', @@ -52,4 +52,5 @@ navbarCollapse(); // Collapse the navbar when page is scrolled $(window).on('scroll', navbarCollapse); + })(jQuery); // End of use strict diff --git a/src/js/scripts.js b/src/js/scripts.js index 203264b..a1e49d3 100644 --- a/src/js/scripts.js +++ b/src/js/scripts.js @@ -1,17 +1,17 @@ (function ($) { "use strict"; // Start of use strict - // Smooth scrolling using jQuery easing + // Smooth scrolling using anime.js $('a.js-scroll-trigger[href*="#"]:not([href="#"])').on('click', function () { if ( location.pathname.replace(/^\//, "") == - this.pathname.replace(/^\//, "") && + this.pathname.replace(/^\//, "") && location.hostname == this.hostname ) { var target = $(this.hash); - target = target.length - ? target - : $("[name=" + this.hash.slice(1) + "]"); + target = target.length ? + target : + $("[name=" + this.hash.slice(1) + "]"); if (target.length) { anime({ targets: 'html, body', @@ -47,4 +47,5 @@ navbarCollapse(); // Collapse the navbar when page is scrolled $(window).on('scroll', navbarCollapse); + })(jQuery); // End of use strict