fix(sideMenu): when a drag on content is disallowed, do not prevent default

Closes #1725
This commit is contained in:
Andrew
2014-07-08 08:26:55 -06:00
parent a2fe834a61
commit ab500f2e0c
2 changed files with 22 additions and 30 deletions

View File

@@ -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;