mirror of
https://github.com/gantry/gantry5.git
synced 2026-08-19 01:15:04 -05:00
Menu: Fixed issue with touch devices where ending the scroll gesture on the offcanvas menu would trigger the expansion of a parent menu item (fixes #1620)
This commit is contained in:
@@ -78,7 +78,10 @@ var Menu = new prime({
|
||||
|
||||
if (hasTouchEvents || !this.hoverExpand) {
|
||||
var linkedParent = $(selectors.linkedParent);
|
||||
if (linkedParent) { linkedParent.on('touchend', this.bound('touchend')); }
|
||||
if (linkedParent) {
|
||||
linkedParent.on('touchmove', this.bound('touchmove'));
|
||||
linkedParent.on('touchend', this.bound('touchend'));
|
||||
}
|
||||
this.overlay.on('touchend', this.bound('closeAllDropdowns'));
|
||||
}
|
||||
|
||||
@@ -125,6 +128,11 @@ var Menu = new prime({
|
||||
this.closeDropdown(element);
|
||||
},
|
||||
|
||||
touchmove: function(event) {
|
||||
var target = $(event.target);
|
||||
target.isMoving = true;
|
||||
},
|
||||
|
||||
touchend: function(event) {
|
||||
var selectors = this.selectors,
|
||||
states = this.states;
|
||||
@@ -135,6 +143,14 @@ var Menu = new prime({
|
||||
isGoingBack = target.parent('.g-go-back'),
|
||||
parent, isSelected;
|
||||
|
||||
if (target.isMoving) {
|
||||
target.isMoving = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
target.off('touchmove', this.bound('touchmove'));
|
||||
target.isMoving = false;
|
||||
|
||||
if (indicator) {
|
||||
target = indicator;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user