Fix weird iOS scrolling and zooming bugs

This commit is contained in:
Roland Rytz 2017-04-10 23:56:35 +02:00
parent 205a416a5e
commit 35e484cd0e
8 changed files with 66 additions and 18 deletions

View file

@ -86996,7 +86996,11 @@ function initView(){
} }
container.addEventListener("mousemove", function(e){ container.addEventListener("mousemove", function(e){
if(!e.sourceCapabilities.firesTouchEvents){ if(e.sourceCapabilities){
if(!e.sourceCapabilities.firesTouchEvents){
updateHovering(e);
}
} else {
updateHovering(e); updateHovering(e);
} }
}); });
@ -88238,7 +88242,15 @@ function init(){
e.preventDefault(); e.preventDefault();
}); });
container.addEventListener("touchstart", touchstart); container.addEventListener("touchstart", function(e){
if(e.touches.length == 2){
e.preventDefault();
}
touchstart(e);
});
function mousedown(x, y){ function mousedown(x, y){
lastPosition = [x, y]; lastPosition = [x, y];
@ -88280,7 +88292,17 @@ function init(){
e.preventDefault(); e.preventDefault();
} }
}); });
window.addEventListener("touchmove", touchmove); window.addEventListener("touchmove", function(e){
if(e.touches.length == 2 || e.scale > 1){
e.preventDefault();
}
touchmove(e);
},
{passive: false}
);
function mousemove(x, y){ function mousemove(x, y){
if(dragging){ if(dragging){

View file

@ -66,6 +66,7 @@ #wrapper{
overflow: hidden; overflow: hidden;
overflow-x: hidden; overflow-x: hidden;
overflow-y: hidden; overflow-y: hidden;
-webkit-overflow-scrolling: touch;
} }
a{ a{
@ -237,6 +238,8 @@ #container{
height: 100%; height: 100%;
margin-left: 320px; margin-left: 320px;
touch-action: manipulation;
overflow: hidden; overflow: hidden;
overflow-x: hidden; overflow-x: hidden;
overflow-y: hidden; overflow-y: hidden;

View file

@ -76867,11 +76867,11 @@ var atlas = [
] ]
}, { }, {
"id": 1279, "id": 1279,
"submitted_by": "sunnyotakuu", "submitted_by": "",
"name": "Originally a gun for a Bulletkin.", "name": "The Lost Gun",
"description": "Before being overrun by pixels, there was a Bulletkin from the game 'Enter the Gungeon' residing in this area, and this was his gun.", "description": "The lost gun is an inside joke on Haven, a small Discord server.",
"website": "http://dodgeroll.com/gungeon/", "website": "",
"subreddit": "/r/EnterTheGungeon/", "subreddit": "",
"center": [ "center": [
977.5, 977.5,
900.5 900.5

View file

@ -253,7 +253,15 @@ function init(){
e.preventDefault(); e.preventDefault();
}); });
container.addEventListener("touchstart", touchstart); container.addEventListener("touchstart", function(e){
if(e.touches.length == 2){
e.preventDefault();
}
touchstart(e);
});
function mousedown(x, y){ function mousedown(x, y){
lastPosition = [x, y]; lastPosition = [x, y];
@ -295,7 +303,17 @@ function init(){
e.preventDefault(); e.preventDefault();
} }
}); });
window.addEventListener("touchmove", touchmove); window.addEventListener("touchmove", function(e){
if(e.touches.length == 2 || e.scale > 1){
e.preventDefault();
}
touchmove(e);
},
{passive: false}
);
function mousemove(x, y){ function mousemove(x, y){
if(dragging){ if(dragging){

File diff suppressed because one or more lines are too long

View file

@ -152,7 +152,11 @@ function initView(){
} }
container.addEventListener("mousemove", function(e){ container.addEventListener("mousemove", function(e){
if(!e.sourceCapabilities.firesTouchEvents){ if(e.sourceCapabilities){
if(!e.sourceCapabilities.firesTouchEvents){
updateHovering(e);
}
} else {
updateHovering(e); updateHovering(e);
} }
}); });

View file

@ -68,7 +68,7 @@ <h2>How to contribute</h2>
<p>Please read <a href="https://reddit.com/r/placeAtlas/comments/63afic/how_to_contribute/" target="_blank">this post on reddit</a> to learn how to submit a new entry.</p> <p>Please read <a href="https://reddit.com/r/placeAtlas/comments/63afic/how_to_contribute/" target="_blank">this post on reddit</a> to learn how to submit a new entry.</p>
<p>The <a href="https://reddit.com/r/placeAtlas/" target="_blank">/r/placeAtlas</a> subreddit is also the place to submit all bug reports, feature requests or questions.</p> <p>The <a href="https://reddit.com/r/placeAtlas/" target="_blank">/r/placeAtlas</a> subreddit is also the place to submit all bug reports, feature requests or questions.</p>
<h2>Contributors</h2> <h2>Contributors</h2>
<p>The Atlas would not have been possible without the help of the following 715 reddit users.</p> <p>The Atlas would not have been possible without the help of the following 716 reddit users.</p>
<p>Thank you to everyone who contributed.</p> <p>Thank you to everyone who contributed.</p>
<div id="contributors"> <div id="contributors">
<a href="https://reddit.com/user/-Chowder-" target="_blank">-Chowder-</a> <a href="https://reddit.com/user/-Chowder-" target="_blank">-Chowder-</a>
@ -743,6 +743,7 @@ <h2>Contributors</h2>
<a href="https://reddit.com/user/vgf89" target="_blank">vgf89</a> <a href="https://reddit.com/user/vgf89" target="_blank">vgf89</a>
<a href="https://reddit.com/user/VIDCAs17" target="_blank">VIDCAs17</a> <a href="https://reddit.com/user/VIDCAs17" target="_blank">VIDCAs17</a>
<a href="https://reddit.com/user/Vikinggiraffe" target="_blank">Vikinggiraffe</a> <a href="https://reddit.com/user/Vikinggiraffe" target="_blank">Vikinggiraffe</a>
<a href="https://reddit.com/user/ViKomprenas" target="_blank">ViKomprenas</a>
<a href="https://reddit.com/user/vman81" target="_blank">vman81</a> <a href="https://reddit.com/user/vman81" target="_blank">vman81</a>
<a href="https://reddit.com/user/Vocalite" target="_blank">Vocalite</a> <a href="https://reddit.com/user/Vocalite" target="_blank">Vocalite</a>
<a href="https://reddit.com/user/voliol" target="_blank">voliol</a> <a href="https://reddit.com/user/voliol" target="_blank">voliol</a>

View file

@ -26,7 +26,6 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="./_css/style.css?version=1.0.24" rel="stylesheet" type="text/css" media="all">
<title> <title>
The /r/place Atlas The /r/place Atlas
</title> </title>
@ -39,7 +38,10 @@
<meta name="google-site-verification" content="gZGHpBSMzffAbIn0qB8b00We6EwSGkDTfDoQVv-NWss" /> <meta name="google-site-verification" content="gZGHpBSMzffAbIn0qB8b00We6EwSGkDTfDoQVv-NWss" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
<link href="./_css/style.css?version=1.0.28" rel="stylesheet" type="text/css" media="all">
</head> </head>
<body> <body>
<div id="wrapper"> <div id="wrapper">
@ -188,7 +190,7 @@ <h2>Tux</h2>
<script type="text/javascript" src="./_js/main.js?version=1.0.3"></script> <script type="text/javascript" src="./_js/main.js?version=1.0.3"></script>
--> -->
<script type="text/javascript" src="./_js/minified.js?version=1.0.85"></script> <script type="text/javascript" src="./_js/minified.js?version=1.0.89"></script>
</body> </body>