* @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');
}
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