Avoid fullscreen when swiping

This commit is contained in:
Tobias Reich 2014-03-26 23:52:25 +01:00
parent 086131c222
commit 749c2cd9ab
3 changed files with 9 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -104,6 +104,7 @@ $(document).ready(function(){
/* Fullscreen on mobile */
if (mobileBrowser()) {
$(document).on("touchend", "#image", function(e) {
if (swipe.obj!==null&&(swipe.offset<=-5||swipe.offset>=5)) return false;
if (visible.controls()) view.header.hide(e, 0);
else view.header.show();
});

View File

@ -9,6 +9,7 @@ swipe = {
obj: null,
tolerance: 150,
offset: 0,
start: function(obj, tolerance) {
@ -25,12 +26,12 @@ swipe = {
console.log(e);
e.x *= -1;
offset = -1 * e.x;
swipe.obj.css({
WebkitTransform: 'translateX(' + e.x + 'px)',
MozTransform: 'translateX(' + e.x + 'px)',
transform: 'translateX(' + e.x + 'px)'
WebkitTransform: 'translateX(' + offset + 'px)',
MozTransform: 'translateX(' + offset + 'px)',
transform: 'translateX(' + offset + 'px)'
});
},
@ -51,6 +52,7 @@ swipe = {
}
swipe.obj = null;
swipe.offset = 0;
}