]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
[Drilldown] Add an 'else' clause to not let the $wrapper property undefined
authorMarc Langevin <marc.langevin@gmail.com>
Mon, 19 Dec 2016 14:31:29 +0000 (15:31 +0100)
committerGitHub <noreply@github.com>
Mon, 19 Dec 2016 14:31:29 +0000 (15:31 +0100)
If the parent of the drilldown menu already has the 'is-drilldown' css class, the $wrapper property used everywhere in the plugin stays undefined. Fixes that issue.

js/foundation.drilldown.js

index 665ab2dcc9a3c44ec5c0bb4b728ba9a602f3367f..f206689af223d5dd01134aafd6731f6c3e94a07c 100644 (file)
@@ -108,6 +108,8 @@ class 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());
     }
   }