From: Nicolas Coden Date: Sat, 7 Apr 2018 21:47:52 +0000 (+0200) Subject: fix: fix Magellan hash resolution without active link X-Git-Tag: v6.6.0~3^2~240^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11142%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fix: fix Magellan hash resolution without active link --- diff --git a/js/foundation.magellan.js b/js/foundation.magellan.js index 7c19cbb13..68784a7f0 100644 --- a/js/foundation.magellan.js +++ b/js/foundation.magellan.js @@ -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 = $(); }