From: Kevin Ball Date: Wed, 19 Jul 2017 22:45:56 +0000 (-0700) Subject: Move feather inside of init for accordion, drilldown, and dropdown menus X-Git-Tag: v6.4.2-rc2~1^2~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10439%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Move feather inside of init for accordion, drilldown, and dropdown menus --- 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');