]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Update foundation.drilldown.js 9525/head
authorMarc Langevin <marc.langevin@gmail.com>
Wed, 21 Dec 2016 15:34:24 +0000 (16:34 +0100)
committerGitHub <noreply@github.com>
Wed, 21 Dec 2016 15:34:24 +0000 (16:34 +0100)
js/foundation.drilldown.js

index f206689af223d5dd01134aafd6731f6c3e94a07c..ce484966fa544fd50e12d0bb37f7c04ee364a412 100644 (file)
@@ -103,14 +103,16 @@ class Drilldown {
     if(!this.options.autoHeight) {
       this.$submenus.addClass('drilldown-submenu-cover-previous');
     }
-
+    
+    // create a wrapper on element if it doesn't exist.
     if(!this.$element.parent().hasClass('is-drilldown')){
       this.$wrapper = $(this.options.wrapper).addClass('is-drilldown');
       if(this.options.animateHeight) this.$wrapper.addClass('animate-height');
-      this.$wrapper = this.$element.wrap(this.$wrapper).parent().css(this._getMaxDims());
-    } else {
-      this.$wrapper = this.$element.parent().css(this._getMaxDims());
+      this.$element.wrap(this.$wrapper);
     }
+    // set wrapper
+    this.$wrapper = this.$element.parent();
+    this.$wrapper.css(this._getMaxDims());
   }
 
   _resize() {