]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: follow relative and absolute links in SmoothScroll #11506 11510/head
authorNicolas Coden <nicolas@ncoden.fr>
Thu, 20 Sep 2018 21:46:56 +0000 (23:46 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Thu, 20 Sep 2018 21:46:56 +0000 (23:46 +0200)
Closes https://github.com/zurb/foundation-sites/issues/11506

js/foundation.smoothScroll.js

index 1d692ba45eea698373f81d85563214882cd7ecec..a90e0965ad09f81515db0f73090822f12a33b11d 100644 (file)
@@ -48,10 +48,8 @@ class SmoothScroll extends Plugin {
 
         // click handler function.
         var handleLinkClick = function(e) {
-            // exit function if the event source isn't coming from an anchor with href attribute starts with '#'
-            if(!$(this).is('a[href^="#"]'))  {
-                return false;
-            }
+            // Follow the link it does not point to an anchor.
+            if (!$(this).is('a[href^="#"]')) return;
 
             var arrival = this.getAttribute('href');