From 5c32f103a34a292e6e00aa8c61b9d1e48d4e679b Mon Sep 17 00:00:00 2001 From: Kevin Ball Date: Mon, 19 Jun 2017 14:43:39 -0700 Subject: [PATCH] by default auto-apply drilldown class --- js/foundation.drilldown.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/foundation.drilldown.js b/js/foundation.drilldown.js index e5797b1d9..ef99dc65e 100644 --- a/js/foundation.drilldown.js +++ b/js/foundation.drilldown.js @@ -48,6 +48,9 @@ class Drilldown extends Plugin { * @private */ _init() { + if(this.options.autoApplyClass) { + this.$element.addClass('drilldown'); + } this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a'); this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]'); this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'menuitem').find('a'); @@ -427,6 +430,14 @@ class Drilldown extends Plugin { } Drilldown.defaults = { + /** + * Drilldowns depend on styles in order to function properly; in the default build of Foundation these are + * on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization. + * @option + * @type {boolian} + * @default true + */ + autoApplyClass: true, /** * Markup used for JS generated back button. Prepended or appended (see backButtonPosition) to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\`) if copy and pasting. * @option -- 2.47.2