From: Benoît Pin Date: Thu, 17 Jul 2014 08:21:48 +0000 (+0200) Subject: Bugfix. Android ready. X-Git-Url: https://scm.cri.ensmp.fr/git/Portfolio.git/commitdiff_plain/ac93b62d919ba13d13ec3f5f2189776093483e53?ds=sidebyside Bugfix. Android ready. --- diff --git a/skins/photo_film_viewer.js b/skins/photo_film_viewer.js index 7561e24..1ad17ce 100644 --- a/skins/photo_film_viewer.js +++ b/skins/photo_film_viewer.js @@ -613,17 +613,20 @@ else if (browser.isIE6up) { FilmSlider.prototype.touchStartHandler = function(evt) { this.filmStartX = parseInt(this.film.style.left, 10); - this.touchStartX = evt.pageX; + this.touchStartX = evt.changedTouches[0].screenX; }; FilmSlider.prototype.touchMoveHandler = function(evt) { disableDefault(evt); - var delta = this.touchStartX - evt.pageX; + var delta = this.touchStartX - evt.changedTouches[0].screenX; var posX = this.filmStartX - delta; this.setFilmPosition(posX); }; FilmSlider.prototype.touchEndHandler = function(evt) { + if (evt.changedTouches[0].screenX !== this.touchStartX) { + disableDefault(evt); + } this.touchStartX = undefined; };