iOS webapp enhancements

This commit is contained in:
Bala Clark 2013-08-18 21:13:24 +02:00
parent b677d1ba76
commit 587e2135f3
5 changed files with 22 additions and 0 deletions

View file

@ -74,3 +74,9 @@ body:not(.mobile) .navigate:hover {
background: #86C441;
border-color: #3E7600;
}
* {
-webkit-user-select: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}

View file

@ -3,7 +3,11 @@
<head>
<meta charset="utf8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>Basic</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="comicbook/js/comicbook.min.js"></script>
<link rel="stylesheet" href="comicbook/comicbook.css">

View file

@ -3,6 +3,8 @@
<head>
<meta charset="utf8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>Dev</title>

View file

@ -9,7 +9,11 @@
<head>
<meta charset="utf8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>App</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="bitjs/io.js"></script>
<script src="bitjs/archive.js"></script>

View file

@ -91,10 +91,16 @@ var ComicBook = (function ($) {
this.isMobile = false;
// mobile enhancements
if (navigator.userAgent.match(/mobile/i)) {
this.isMobile = true;
document.body.classList.add('mobile');
defaults.displayMode = 'single';
window.addEventListener('load', function () {
setTimeout(function () {
window.scrollTo(0, 1);
}, 0);
});
}
var options = merge(defaults, opts); // options array for internal use