]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
by default auto-apply drilldown class
authorKevin Ball <kmball11@gmail.com>
Mon, 19 Jun 2017 21:43:39 +0000 (14:43 -0700)
committerKevin Ball <kmball11@gmail.com>
Mon, 19 Jun 2017 21:43:39 +0000 (14:43 -0700)
js/foundation.drilldown.js

index e5797b1d908fb20ce2f8cb6dc0860ce3b4467b8c..ef99dc65e5d27b001d8897152892de39d15f65d5 100644 (file)
@@ -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