فهرست منبع

delay support to simulate util

Adam Shaw 9 سال پیش
والد
کامیت
2ba0525219
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 6 1
      tests/lib/simulate.js

+ 6 - 1
tests/lib/simulate.js

@@ -183,10 +183,15 @@ function simulateDrag(self, targetNode, startPoint, dx, dy, moveCnt, duration, o
 			self.simulateEvent(targetNode, isTouch ? 'touchstart' : 'mousedown', clientCoords);
 		}
 
+		var delay = options.delay || 0;
 		if (debug) {
+			delay = Math.max(delay, DEBUG_DELAY);
+		}
+
+		if (delay) {
 			setTimeout(function() {
 				startMoving();
-			}, DEBUG_DELAY);
+			}, delay);
 		}
 		else {
 			startMoving();