]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fixes #7449 [Magellan] Last menu element active on load if body has no margin 7450/head
authorAfonso Duarte <afonsomartins@gmail.com>
Tue, 8 Dec 2015 13:53:15 +0000 (13:53 +0000)
committerAfonso Duarte <afonsomartins@gmail.com>
Tue, 8 Dec 2015 14:01:45 +0000 (14:01 +0000)
Uses document.documentElement.clientHeight to calculate viewport height instead of document.body.clientHeight. See http://jsfiddle.net/tzdcx/1/ for differences between the two.

js/foundation.magellan.js

index a9620337cd2da41280e3dfbca20f80960e10a01c..db05a17a580009aba1dcdbdea33d72cc210e9062 100644 (file)
@@ -93,7 +93,7 @@
         html = document.documentElement;
 
     this.points = [];
-    this.winHeight = Math.round(Math.max(window.innerHeight, document.body.clientHeight));
+    this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight));
     this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight));
 
     this.$targets.each(function(){