Verified isSingleTouch and isMultiTouch functions.

This commit is contained in:
ahocevar
2012-06-20 16:02:41 +02:00
parent 66a5a8ad7a
commit f74d265dec
2 changed files with 17 additions and 5 deletions

View File

@@ -11,21 +11,21 @@ goog.require('goog.style');
/**
* Determine whether event was caused by a single touch
*
* @param {Event} evt
* @param {!Event} evt
* @return {boolean}
*/
ol.event.isSingleTouch = function(evt) {
return evt.touches && evt.touches.length == 1;
return !!(evt.touches && evt.touches.length == 1);
};
/**
* Determine whether event was caused by a multi touch
*
* @param {Event} evt
* @param {!Event} evt
* @return {boolean}
*/
ol.event.isMultiTouch = function(evt) {
return evt.touches && evt.touches.length > 1;
return !!(evt.touches && evt.touches.length > 1);
};