mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(sideMenu): when a drag on content is disallowed, do not prevent default
Closes #1725
This commit is contained in:
@@ -278,28 +278,11 @@
|
||||
this._startX = null;
|
||||
this._lastX = null;
|
||||
this._offsetX = null;
|
||||
this._firstX = null;
|
||||
this._doDrag = false;
|
||||
},
|
||||
|
||||
// Handle a drag event
|
||||
_handleDrag: function(e) {
|
||||
|
||||
//Get the start position of the drag
|
||||
if (!this._firstX) {
|
||||
this._firstX = e.gesture.touches[0].pageX;
|
||||
this.content._cachedWidth = this.content.element.offsetWidth;
|
||||
}
|
||||
|
||||
//Allow the drag to affect the side if:
|
||||
// - the side menu is already opened, or
|
||||
// - there is no edge drag threshold enabled, or
|
||||
// - the drag is within the edge drag threshold
|
||||
this._doDrag = this.isOpen() ||
|
||||
!this.edgeDragThreshold() ||
|
||||
this._firstX <= this.dragThreshold ||
|
||||
this._firstX >= this.content._cachedWidth - this.dragThreshold;
|
||||
|
||||
// If we don't have start coords, grab and store them
|
||||
if(!this._startX) {
|
||||
this._startX = e.gesture.touches[0].pageX;
|
||||
@@ -310,7 +293,7 @@
|
||||
}
|
||||
|
||||
// Calculate difference from the tap points
|
||||
if(!this._isDragging && this._doDrag && Math.abs(this._lastX - this._startX) > this.dragThresholdX) {
|
||||
if(!this._isDragging && Math.abs(this._lastX - this._startX) > this.dragThresholdX) {
|
||||
// if the difference is greater than threshold, start dragging using the current
|
||||
// point as the starting point
|
||||
this._startX = this._lastX;
|
||||
|
||||
Reference in New Issue
Block a user