]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: fix Magellan hash resolution without active link 11142/head
authorNicolas Coden <nicolas@ncoden.fr>
Sat, 7 Apr 2018 21:47:52 +0000 (23:47 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Sat, 7 Apr 2018 21:47:52 +0000 (23:47 +0200)
js/foundation.magellan.js

index 7c19cbb136b95ed9757181fb97422644de19f838..68784a7f00ec21bfccaec39d3201db0273e14004 100644 (file)
@@ -177,7 +177,7 @@ class Magellan extends Plugin {
     let activeHash = '';
     if(activeIdx !== undefined){
       this.$active = this.$links.filter('[href="#' + this.$targets.eq(activeIdx).data('magellan-target') + '"]');
-      activeHash = this.$active[0].getAttribute('href');
+      if (this.$active.length) activeHash = this.$active[0].getAttribute('href');
     }else{
       this.$active = $();
     }