Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2275 from bryan-m-hughes/timob-8778

[TIMOB-8778] Implemented gesture rate limiting.
  • Loading branch information...
commit ef65d0466928819b9b4141dc7451a9a77670a619 2 parents abdf50b + 083b4d9
@cb1kenobi cb1kenobi authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 mobileweb/titanium/Ti/_/UI/Element.js
View
11 mobileweb/titanium/Ti/_/UI/Element.js
@@ -46,6 +46,7 @@ define(
constructor: function(args) {
var self = this,
+ touchMoveBlocked = false,
node = this.domNode = this._setFocusNode(dom.create(this.domType || "div", {
className: "TiUIElement " + css.clean(this.declaredClass),
@@ -80,7 +81,6 @@ define(
require.has("devmode") && args && args._debug && dom.attr.set(node, "data-debug", args._debug);
function processTouchEvent(eventType, evt) {
- has("ti-instrumentation") && (this._gestureInstrumentationTest = instrumentation.startTest("Gesture Processing"));
var i,
gestureRecognizers = touchRecognizers[eventType],
touches = evt.changedTouches;
@@ -102,7 +102,6 @@ define(
for (i in gestureRecognizers) {
gestureRecognizers[i]["finalize" + eventType]();
}
- has("ti-instrumentation") && instrumentation.stopTest(this._gestureInstrumentationTest, "Processing widget " + self.widgetId);
}
this._touching = false;
@@ -112,7 +111,13 @@ define(
on(this.domNode, useTouch ? "touchstart" : "mousedown", function(evt){
var handles = [
on(window, useTouch ? "touchmove" : "mousemove", function(evt){
- (useTouch || self._touching) && processTouchEvent("Move", evt);
+ if (!touchMoveBlocked) {
+ touchMoveBlocked = true;
+ (useTouch || self._touching) && processTouchEvent("Move", evt);
+ setTimeout(function(){
+ touchMoveBlocked = false;
+ }, 30);
+ }
}),
on(window, useTouch ? "touchend" : "mouseup", function(evt){
self._touching = false;
Please sign in to comment.
Something went wrong with that request. Please try again.