瀏覽代碼

scrollAlwaysKills, ugh

Adam Shaw 9 年之前
父節點
當前提交
5256981754
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 2 1
      src/common/DragListener.js
  2. 2 0
      src/common/Grid.js

+ 2 - 1
src/common/DragListener.js

@@ -27,6 +27,7 @@ var DragListener = FC.DragListener = Class.extend(ListenerMixin, {
 	minDistance: null,
 
 	shouldCancelTouchScroll: true,
+	scrollAlwaysKills: false,
 
 
 	constructor: function(options) {
@@ -277,7 +278,7 @@ var DragListener = FC.DragListener = Class.extend(ListenerMixin, {
 	handleTouchScroll: function(ev) {
 		// if the drag is being initiated by touch, but a scroll happens before
 		// the drag-initiating delay is over, cancel the drag
-		if (!this.isDragging) {
+		if (!this.isDragging || this.scrollAlwaysKills) {
 			this.endInteraction(ev, true); // isCancelled=true
 		}
 	},

+ 2 - 0
src/common/Grid.js

@@ -355,6 +355,8 @@ var Grid = FC.Grid = Class.extend(ListenerMixin, {
 		// which will kill any touchmoving/scrolling. Prevent this.
 		dragListener.shouldCancelTouchScroll = false;
 
+		dragListener.scrollAlwaysKills = true;
+
 		return dragListener;
 	},