Adam Shaw 10 лет назад
Родитель
Сommit
4898aaf4dc
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      src/common/DragListener.js

+ 6 - 6
src/common/DragListener.js

@@ -133,6 +133,10 @@ var DragListener = FC.DragListener = Class.extend(ListenerMixin, {
 					}
 				}
 			});
+
+			if (this.scrollEl) {
+				this.listenTo(this.scrollEl, 'scroll', this.handleTouchScroll);
+			}
 		}
 		else {
 			this.listenTo($(document), {
@@ -145,10 +149,6 @@ var DragListener = FC.DragListener = Class.extend(ListenerMixin, {
 			selectstart: preventDefault, // don't allow selection while dragging
 			contextmenu: preventDefault // long taps would open menu on Chrome dev tools
 		});
-
-		if (this.scrollEl) {
-			this.listenTo(this.scrollEl, 'scroll', this.handleScroll);
-		}
 	},
 
 
@@ -285,10 +285,10 @@ var DragListener = FC.DragListener = Class.extend(ListenerMixin, {
 	// -----------------------------------------------------------------------------------------------------------------
 
 
-	handleScroll: function(ev) {
+	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.isTouch && !this.isDragging) {
+		if (!this.isDragging) {
 			this.endInteraction(ev);
 		}
 	},