From: Kristofer Krause Date: Thu, 1 Oct 2015 17:23:17 +0000 (-0400) Subject: call adjust_pip only if necessary X-Git-Tag: v6.0.0~35^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6903%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git call adjust_pip only if necessary --- diff --git a/js/foundation/foundation.dropdown.js b/js/foundation/foundation.dropdown.js index bcbc7b10d..8c3c100ef 100644 --- a/js/foundation/foundation.dropdown.js +++ b/js/foundation/foundation.dropdown.js @@ -329,7 +329,7 @@ p.left = p.left - this.outerWidth() + t.outerWidth(); } - if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) { + if (!self.settings.no_pip && t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) { self.adjust_pip(this, t, s, p); } @@ -349,7 +349,7 @@ p.left = p.left - this.outerWidth() + t.outerWidth(); } - if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) { + if (!self.settings.no_pip && t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) { self.adjust_pip(this, t, s, p); } @@ -389,7 +389,7 @@ var self = Foundation.libs.dropdown; - if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) { + if (!self.settings.no_pip && t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) { self.adjust_pip(this, t, s, p); } @@ -399,11 +399,11 @@ // Insert rule to style psuedo elements adjust_pip : function (dropdown, target, settings, position) { + if (settings.no_pip === true) return; + var sheet = Foundation.stylesheet, pip_offset_base = 8; - if (settings.no_pip === true) return; - if (dropdown.hasClass(settings.mega_class)) { pip_offset_base = position.left + (target.outerWidth() / 2) - 8; } else if (this.small()) {