Permalink
Browse files

Add linen texture as bg of app

Fix problem where opening keyboard caused header to scroll down in a weird way
Added .gitignore for .DS_Store
  • Loading branch information...
benbrown committed Oct 21, 2011
1 parent 1441399 commit fc2093dcef7150b03dca6cb74a5700468796a69f
Showing with 50 additions and 6 deletions.
  1. +1 −0 .gitignore
  2. +1 −5 css/xapp.css
  3. BIN img/linen.png
  4. +48 −1 js/xapp.js
View
@@ -0,0 +1 @@
+.DS_Store
View
@@ -2,7 +2,7 @@
body,canvas,div,li,a,p { -webkit-user-select: none }
body {
- background: #000;
+ background: #000 url(../img/linen.png);
padding: 0px;
margin: 0px;
overflow-y: hidden;
@@ -30,7 +30,6 @@ body {
margin-right: auto;
overflow-x: hidden;
overflow-y: auto;
- background: #FFF;
/* position: fixed; */
}
@@ -41,14 +40,12 @@ body {
overflow-x: hidden;
width: 320px;
z-index: 1;
- background: #FFF;
}
div#application > #pages > #scroller {
position: relative;
width: 3000px;
min-height: 430px;
- background: #F0F0F0;
-webkit-transform: rotate(0deg);
}
@@ -57,7 +54,6 @@ body {
position: relative;
width: 3000px;
min-height: 430px;
- background: #F0F0F0;
/* -webkit-transition: left 300ms ease; */
-webkit-transform: rotate(0deg);
}
View
Binary file not shown.
View
@@ -23,6 +23,8 @@ var XAPP = (function() {
var LOCAL_STORAGE;
return {
+
+ scrollwatch: false,
boot: function() {
LOCAL_STORAGE= new Lawnchair(function(){});
@@ -83,8 +85,53 @@ var XAPP = (function() {
});
// stop the entire app from being moved outside of the main window
- $('body').bind('touchmove',function(e) { e.preventDefault(); });
+ $('body').bind('touchmove',function(e) {
+ e.preventDefault();
+ });
+
+/*
+ var preventDefaultScroll = function(event) {
+ event.preventDefault();
+ window.scroll(0,0);
+ return false;
+ };
+ document.addEventListener('touchmove', preventDefaultScroll, false);
+
+*/
+
+/*
+ $('input').focus(function() {
+ var y = $(this).position().top;
+ y -= 100;
+ if (y < 0) {
+ y = 0;
+ }
+ window.scroll(0,0);
+ $('div#application > #pages > #scroller').touchScroll('setPosition',y);
+ return true;
+ });
+*/
+
+ $('input').focus(function() {
+ if (XAPP.scrollwatch) {
+ clearTimeout(XAPP.scrollwatch);
+ XAPP.scrollwatch = null;
+ }
+ });
+
+
+ $('input').blur(function() {
+ // FIX THIS
+ // It would be better if we were able to find a way to detect when the
+ // keyboard is hidden, instead of depending on the inputs blurring
+ // but what this does is:
+ // in 100 miliseconds, it will scroll the widnow back to the top
+ // UNLESS another input is focused in the meantime.
+ XAPP.scrollwatch = setTimeout(function() { window.scroll(0,0); },100);
+ });
+
+
$('div#application > footer > a').live('click',this.switchTab);
// make sure accessory clicks do not fire the main row selection

0 comments on commit fc2093d

Please sign in to comment.