Re-use handler
This commit is contained in:
@@ -80,6 +80,15 @@ ol.pointer.TouchSource = function(dispatcher, mouseSource) {
|
|||||||
* @type {number|undefined}
|
* @type {number|undefined}
|
||||||
*/
|
*/
|
||||||
this.resetId_ = undefined;
|
this.resetId_ = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {function()}
|
||||||
|
*/
|
||||||
|
this.resetClickCountHandler_ = goog.bind(function() {
|
||||||
|
this.clickCount_ = 0;
|
||||||
|
this.resetId_ = undefined;
|
||||||
|
}, this);
|
||||||
};
|
};
|
||||||
goog.inherits(ol.pointer.TouchSource, ol.pointer.EventSource);
|
goog.inherits(ol.pointer.TouchSource, ol.pointer.EventSource);
|
||||||
|
|
||||||
@@ -147,11 +156,7 @@ ol.pointer.TouchSource.prototype.removePrimaryPointer_ = function(inPointer) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.pointer.TouchSource.prototype.resetClickCount_ = function() {
|
ol.pointer.TouchSource.prototype.resetClickCount_ = function() {
|
||||||
var fn = function() {
|
this.resetId_ = goog.global.setTimeout(this.resetClickCountHandler_,
|
||||||
this.clickCount_ = 0;
|
|
||||||
this.resetId_ = undefined;
|
|
||||||
};
|
|
||||||
this.resetId_ = goog.global.setTimeout(goog.bind(fn, this),
|
|
||||||
ol.pointer.TouchSource.CLICK_COUNT_TIMEOUT);
|
ol.pointer.TouchSource.CLICK_COUNT_TIMEOUT);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user