Permalink
Browse files

#109 Do not prevent default scrolling in the touch enabled browsers w…

…hen map is not zoomed
  • Loading branch information...
1 parent 0ef09e3 commit 58b3b3a8a94ac823a14dd45726a4feb99ae3a8c9 @bjornd committed Oct 1, 2012
Showing with 15 additions and 12 deletions.
  1. +15 −12 lib/world-map.js
View
@@ -325,23 +325,26 @@ jvm.WorldMap.prototype = {
});
jvm.$(this.container).bind('touchmove', function(e){
var touch;
- if (e.originalEvent.touches.length == 1 && touchX && touchY) {
- touch = e.originalEvent.touches[0];
- map.transX -= (touchX - touch.pageX) / map.scale;
- map.transY -= (touchY - touch.pageY) / map.scale;
+ if (map.scale != map.baseScale) {
+ if (e.originalEvent.touches.length == 1 && touchX && touchY) {
+ touch = e.originalEvent.touches[0];
- map.applyTransform();
+ map.transX -= (touchX - touch.pageX) / map.scale;
+ map.transY -= (touchY - touch.pageY) / map.scale;
- map.label.hide();
+ map.applyTransform();
- touchX = touch.pageX;
- touchY = touch.pageY;
- } else {
- touchX = false;
- touchY = false;
+ map.label.hide();
+
+ touchX = touch.pageX;
+ touchY = touch.pageY;
+ } else {
+ touchX = false;
+ touchY = false;
+ }
+ return false;
}
- return false;
});
},

0 comments on commit 58b3b3a

Please sign in to comment.