From: Kevin Ball Date: Mon, 19 Jun 2017 21:43:39 +0000 (-0700) Subject: by default auto-apply drilldown class X-Git-Tag: v6.4.0-rc4~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c32f103a34a292e6e00aa8c61b9d1e48d4e679b;p=thirdparty%2Ffoundation%2Ffoundation-sites.git by default auto-apply drilldown class --- 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