/**
* DropdownMenu module.
- * @module foundation.dropdown-menu
+ * @module foundation.dropdownMenu
* @requires foundation.util.keyboard
* @requires foundation.util.box
* @requires foundation.util.nest
};
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){
}
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);
_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) {
}
});
}
- 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),
_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');
});
}
* 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]);
}
/**
* Fires when the open menus are closed.
* @event DropdownMenu#hide
*/
- this.$element.trigger('hide.zf.dropdownmenu', [$toClose]);
+ this.$element.trigger('hide.zf.dropdownMenu', [$toClose]);
}
}
* @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');
}
}