Permalink
Browse files

Working badly hacked version of scrollTo for android

  • Loading branch information...
1 parent fe50682 commit 63fdf51976186176835c808bfc6bbe8b2e77c7f0 @yuvipanda committed Apr 17, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 assets/www/android/platform.js
@@ -59,12 +59,13 @@ function setPageActionsState(state) {
})();
chrome.scrollTo = function(selector, posY) {
- console.log("MODIFIED!");
- var $el = $(selector);
- $el.hide().scrollTop(posY);
- window.setTimeout(function() {
- $el.show();
- }, 0);
+ // scrollTop seems completely useless on Android 2.x, unable to test so far on 4.x
+ // This is the exact opposite of what we noticed on 2.x in the previous release
+ // I've no idea why this is happening, neither does jon
+ // This gives us what we want for now, but now for non-zero scroll positions the
+ // behavior of scrollTo might be different across platforms.
+ // Ugh. Will bite us when we try to do hashlinks.
+ window.scrollTo(0, posY);
}
chrome.addPlatformInitializer(function() {

0 comments on commit 63fdf51

Please sign in to comment.