From 7cdd85a09b0e663d0e78d9333742e6da51d42e9e Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Wed, 21 Feb 2018 10:30:01 +0100 Subject: [PATCH] fix: camelcase the event names of the Dropdown Menu --- js/foundation.dropdownMenu.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/js/foundation.dropdownMenu.js b/js/foundation.dropdownMenu.js index 573116140..917ce29b0 100644 --- a/js/foundation.dropdownMenu.js +++ b/js/foundation.dropdownMenu.js @@ -10,7 +10,7 @@ import { Plugin } from './foundation.plugin'; /** * DropdownMenu module. - * @module foundation.dropdown-menu + * @module foundation.dropdownMenu * @requires foundation.util.keyboard * @requires foundation.util.box * @requires foundation.util.nest @@ -120,12 +120,12 @@ class DropdownMenu extends Plugin { }; if (this.options.clickOpen || hasTouch) { - this.$menuItems.on('click.zf.dropdownmenu touchstart.zf.dropdownmenu', handleClickFn); + this.$menuItems.on('click.zf.dropdownMenu touchstart.zf.dropdownMenu', handleClickFn); } // Handle Leaf element Clicks if(_this.options.closeOnClickInside){ - this.$menuItems.on('click.zf.dropdownmenu', function(e) { + this.$menuItems.on('click.zf.dropdownMenu', function(e) { var $elem = $(this), hasSub = $elem.hasClass(parClass); if(!hasSub){ @@ -135,7 +135,7 @@ class DropdownMenu extends Plugin { } if (!this.options.disableHover) { - this.$menuItems.on('mouseenter.zf.dropdownmenu', function(e) { + this.$menuItems.on('mouseenter.zf.dropdownMenu', function(e) { var $elem = $(this), hasSub = $elem.hasClass(parClass); @@ -145,7 +145,7 @@ class DropdownMenu extends Plugin { _this._show($elem.children('.is-dropdown-submenu')); }, _this.options.hoverDelay)); } - }).on('mouseleave.zf.dropdownmenu', function(e) { + }).on('mouseleave.zf.dropdownMenu', function(e) { var $elem = $(this), hasSub = $elem.hasClass(parClass); if (hasSub && _this.options.autoclose) { @@ -158,7 +158,7 @@ class DropdownMenu extends Plugin { } }); } - this.$menuItems.on('keydown.zf.dropdownmenu', function(e) { + this.$menuItems.on('keydown.zf.dropdownMenu', function(e) { var $element = $(e.target).parentsUntil('ul', '[role="menuitem"]'), isTab = _this.$tabs.index($element) > -1, $elements = isTab ? _this.$tabs : $element.siblings('li').add($element), @@ -270,13 +270,13 @@ class DropdownMenu extends Plugin { _addBodyHandler() { var $body = $(document.body), _this = this; - $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu') - .on('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu', function(e) { + $body.off('mouseup.zf.dropdownMenu touchend.zf.dropdownMenu') + .on('mouseup.zf.dropdownMenu touchend.zf.dropdownMenu', function(e) { var $link = _this.$element.find(e.target); if ($link.length) { return; } _this._hide(); - $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu'); + $body.off('mouseup.zf.dropdownMenu touchend.zf.dropdownMenu'); }); } @@ -312,7 +312,7 @@ class DropdownMenu extends Plugin { * Fires when the new dropdown pane is visible. * @event DropdownMenu#show */ - this.$element.trigger('show.zf.dropdownmenu', [$sub]); + this.$element.trigger('show.zf.dropdownMenu', [$sub]); } /** @@ -354,7 +354,7 @@ class DropdownMenu extends Plugin { * Fires when the open menus are closed. * @event DropdownMenu#hide */ - this.$element.trigger('hide.zf.dropdownmenu', [$toClose]); + this.$element.trigger('hide.zf.dropdownMenu', [$toClose]); } } @@ -363,9 +363,9 @@ class DropdownMenu extends Plugin { * @function */ _destroy() { - this.$menuItems.off('.zf.dropdownmenu').removeAttr('data-is-click') + this.$menuItems.off('.zf.dropdownMenu').removeAttr('data-is-click') .removeClass('is-right-arrow is-left-arrow is-down-arrow opens-right opens-left opens-inner'); - $(document.body).off('.zf.dropdownmenu'); + $(document.body).off('.zf.dropdownMenu'); Nest.Burn(this.$element, 'dropdown'); } } -- 2.47.2