Skip to content

Commit

Permalink
fixed double tap zoom issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tylik1 committed Feb 28, 2018
1 parent 10c13dd commit 6b3a299
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Binary file modified dist/gzipped/viewer.min.js
Binary file not shown.
9 changes: 7 additions & 2 deletions dist/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9453,7 +9453,7 @@ this["amp"]["templates"]["mobileNormalView"] = Handlebars.template({"1":function
Viewer.prototype.bindZoomEvents = function (zoomAction) {
var self = this;
var zoomTraps = self.mainContainerList.find('.zoom-trap');
self.bindTapEvent(zoomTraps, zoomAction.bind(self));
self.bindTapEvent(zoomTraps, zoomAction.bind(self), true);
};

Viewer.prototype._resize = function () {
Expand Down Expand Up @@ -9957,7 +9957,7 @@ this["amp"]["templates"]["mobileNormalView"] = Handlebars.template({"1":function
return state.scale > 1;
};

Viewer.prototype.bindTapEvent = function (element, action) {
Viewer.prototype.bindTapEvent = function (element, action, preventDefault) {
var self = this;
var coords;
var newCoords;
Expand Down Expand Up @@ -9993,6 +9993,11 @@ this["amp"]["templates"]["mobileNormalView"] = Handlebars.template({"1":function

element.on(startEvents, function (e) {
var $self = $(this);

if(preventDefault){
e.preventDefault();
}

if (e.which === 3) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/viewer.min.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions src/js/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@
Viewer.prototype.bindZoomEvents = function (zoomAction) {
var self = this;
var zoomTraps = self.mainContainerList.find('.zoom-trap');
self.bindTapEvent(zoomTraps, zoomAction.bind(self));
self.bindTapEvent(zoomTraps, zoomAction.bind(self), true);
};

Viewer.prototype._resize = function () {
Expand Down Expand Up @@ -1398,7 +1398,7 @@
return state.scale > 1;
};

Viewer.prototype.bindTapEvent = function (element, action) {
Viewer.prototype.bindTapEvent = function (element, action, preventDefault) {
var self = this;
var coords;
var newCoords;
Expand Down Expand Up @@ -1434,6 +1434,11 @@

element.on(startEvents, function (e) {
var $self = $(this);

if(preventDefault){
e.preventDefault();
}

if (e.which === 3) {
return false;
}
Expand Down

0 comments on commit 6b3a299

Please sign in to comment.