From afc633499fceca6cad208535ab6577ee090919f0 Mon Sep 17 00:00:00 2001 From: Kevin Ball Date: Wed, 19 Jul 2017 15:45:56 -0700 Subject: [PATCH] Move feather inside of init for accordion, drilldown, and dropdown menus --- js/foundation.accordionMenu.js | 4 ++-- js/foundation.drilldown.js | 4 ++-- js/foundation.dropdownMenu.js | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/js/foundation.accordionMenu.js b/js/foundation.accordionMenu.js index 17ec7ebe9..53d11ffd1 100644 --- a/js/foundation.accordionMenu.js +++ b/js/foundation.accordionMenu.js @@ -28,8 +28,6 @@ class AccordionMenu extends Plugin { this.options = $.extend({}, AccordionMenu.defaults, this.$element.data(), options); this.className = 'AccordionMenu'; // ie9 back compat - Nest.Feather(this.$element, 'accordion'); - this._init(); Keyboard.register('AccordionMenu', { @@ -50,6 +48,8 @@ class AccordionMenu extends Plugin { * @private */ _init() { + Nest.Feather(this.$element, 'accordion'); + var _this = this; this.$element.find('[data-submenu]').not('.is-active').slideUp(0);//.find('a').css('padding-left', '1rem'); diff --git a/js/foundation.drilldown.js b/js/foundation.drilldown.js index 48e86b0ef..ed38f42a7 100644 --- a/js/foundation.drilldown.js +++ b/js/foundation.drilldown.js @@ -28,8 +28,6 @@ class Drilldown extends Plugin { this.options = $.extend({}, Drilldown.defaults, this.$element.data(), options); this.className = 'Drilldown'; // ie9 back compat - Nest.Feather(this.$element, 'drilldown'); - this._init(); Keyboard.register('Drilldown', { @@ -50,6 +48,8 @@ class Drilldown extends Plugin { * @private */ _init() { + Nest.Feather(this.$element, 'drilldown'); + if(this.options.autoApplyClass) { this.$element.addClass('drilldown'); } diff --git a/js/foundation.dropdownMenu.js b/js/foundation.dropdownMenu.js index 5e2c6974c..e91a0dbb4 100644 --- a/js/foundation.dropdownMenu.js +++ b/js/foundation.dropdownMenu.js @@ -30,7 +30,6 @@ class DropdownMenu extends Plugin { this.options = $.extend({}, DropdownMenu.defaults, this.$element.data(), options); this.className = 'DropdownMenu'; // ie9 back compat - Nest.Feather(this.$element, 'dropdown'); this._init(); Keyboard.register('DropdownMenu', { @@ -50,6 +49,8 @@ class DropdownMenu extends Plugin { * @function */ _init() { + Nest.Feather(this.$element, 'dropdown'); + var subs = this.$element.find('li.is-dropdown-submenu-parent'); this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub'); -- 2.47.2