]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
call adjust_pip only if necessary 6903/head
authorKristofer Krause <kris.krause@gmail.com>
Thu, 1 Oct 2015 17:23:17 +0000 (13:23 -0400)
committerKristofer Krause <kris.krause@gmail.com>
Thu, 1 Oct 2015 17:23:17 +0000 (13:23 -0400)
js/foundation/foundation.dropdown.js

index bcbc7b10df25f56881ccf565ef2d8e23eabe6534..8c3c100efb86d882220fa17067591f22a36414c0 100644 (file)
           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);
         }
 
           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);
         }
 
 
         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);
         }
 
 
     // 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()) {