vendor/assets/javascripts/webshims/shims/jme/mediacontrols-lazy.js in webshims-rails-1.13.0 vs vendor/assets/javascripts/webshims/shims/jme/mediacontrols-lazy.js in webshims-rails-1.14.1
- old
+ new
@@ -40,13 +40,13 @@
if(addTouch){
touchEnd = function(e){
var ret, touch;
e = e.originalEvent || {};
- $(this).off('touchend', touchEnd);
+ $(this).off('touchend touchcancel', touchEnd);
var changedTouches = e.changedTouches || e.touches;
- if(!touchData || !changedTouches || changedTouches.length != 1){
+ if(e.type == 'touchcancel' || !touchData || !changedTouches || changedTouches.length != 1){
return;
}
touch = changedTouches[0];
if(Math.abs(touchData.x - touch.pageX) > 40 || Math.abs(touchData.y - touch.pageY) > 40 || Date.now() - touchData.now > 600){
@@ -73,10 +73,10 @@
touchData = {
x: touch.pageX,
y: touch.pageY,
now: Date.now()
};
- elemTarget.on('touchend', touchEnd);
+ elemTarget.on('touchend touchcancel', touchEnd);
};
this.each(function(){
this.addEventListener('touchstart', touchStart, true);
});