diff options
author | Struan Donald <struan@exo.org.uk> | 2013-08-13 18:26:19 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-08-13 18:26:19 +0100 |
commit | 2da52b3280bc564c684599bdfe54d7eaedacf1ac (patch) | |
tree | 9bd055b9f028a7ae0efca811d13abd0a2addd514 /src/js/app.js | |
parent | 02f154d5377cf642326f0f4ecd4c097e299b5a84 (diff) |
Tweak help panel to work on Android 2
Android 2 doesn't support overflow: scroll so instead make the panel
full screen so you are scrolling what seems to be the screen. This means
we need to reset scrollTop before hiding it as otherwise the underlying
page is also scrolled.
Diffstat (limited to 'src/js/app.js')
-rw-r--r-- | src/js/app.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/js/app.js b/src/js/app.js index f33d0c8..74db8fe 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -151,7 +151,9 @@ var tpl = { console.log( 'viewheight: ' + viewHeight ); console.log( 'top: ' + top ); - help.height(helpHeight - 60); + if ( !help.hasClass('android2') ) { + help.height(helpHeight - 60); + } help.css('left', viewWidth); help.show(); }, @@ -162,7 +164,7 @@ var tpl = { } var help = $('#help'); $('#display-help').hide(); - help.animate({left: 0}, function() { $('#dismiss').show(); } ); + help.animate({left: 0}, function() { $('#help').show(); $('#dismiss').show(); } ); }, helpHide: function(e) { @@ -174,6 +176,9 @@ var tpl = { viewWidth = $(window).width(); $('#dismiss').hide(); + if ( help.hasClass('android2') ) { + $('body').scrollTop(0); + } help.animate({left: viewWidth}, 400, 'swing', function() { $('#display-help').show(); $('#help').scrollTop(0); } ); }, @@ -196,6 +201,9 @@ var tpl = { if ( typeof device !== 'undefined' && device.platform === 'Android' ) { $.mobile.defaultPageTransition = 'none'; FMS.isAndroid = true; + if ( parseInt(device.version) < 3 ) { + $('#help').addClass('android2'); + } } if ( typeof device !== 'undefined' && device.platform === 'iOS' ) { |