diff options
| author | Rene Ae <aehtyb@gmail.com> | 2015-12-04 20:32:44 -0600 |
|---|---|---|
| committer | Rene Ae <aehtyb@gmail.com> | 2015-12-04 20:32:44 -0600 |
| commit | 10efb0f7b426426057fed757fe3c851a249358dd (patch) | |
| tree | b80e285251d30fbca36220c932ef180c29c55dcf /StoneIsland/platforms/android/assets/www/js/lib/view/Scrollable.js | |
| parent | 015b58ff6845b5cb79b13fec109a37b4c10c7813 (diff) | |
android build
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/view/Scrollable.js')
| -rwxr-xr-x | StoneIsland/platforms/android/assets/www/js/lib/view/Scrollable.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/view/Scrollable.js b/StoneIsland/platforms/android/assets/www/js/lib/view/Scrollable.js new file mode 100755 index 00000000..d06ed590 --- /dev/null +++ b/StoneIsland/platforms/android/assets/www/js/lib/view/Scrollable.js @@ -0,0 +1,27 @@ +var ScrollableView = View.extend({ + + events: { + "load img": "deferRefresh", + }, + + deferScrollToTop: function(){ + setTimeout(this.scrollToTop.bind(this), 0) + }, + + refreshScroller: function(){ + this.scroller.refresh() + clearTimeout( this.scrollerRefreshTimeout ) + }, + + scrollerRefreshTimeout: null, + deferRefresh: function(){ + clearTimeout( this.scrollerRefreshTimeout ) + this.scrollerRefreshTimeout = setTimeout(this.refreshScroller.bind(this)) + }, + + scrollToTop: function(){ + this.scroller.refresh() + app.collection.scroller.scrollTo(0, 0) + }, + +})
\ No newline at end of file |
