From c06a5e5ce72e4f5190d444b814b2d3d7e23c9bf6 Mon Sep 17 00:00:00 2001 From: Kristofer Krause Date: Thu, 1 Oct 2015 13:23:17 -0400 Subject: [PATCH] call adjust_pip only if necessary --- js/foundation/foundation.dropdown.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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()) { -- 2.47.2