summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
diff options
context:
space:
mode:
authorRene Ae <aehtyb@gmail.com>2015-12-01 00:51:02 -0600
committerRene Ae <aehtyb@gmail.com>2015-12-01 00:51:02 -0600
commit6415f506034262dd7151be2e35e1e1c1e97f4dfa (patch)
treec6e564e374967725a40fd87f7c5f3a1ba8019089 /StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
parent5e07e273e18a609978253c45f3c5f702b0de4991 (diff)
parent9497b50fa02f3cfa9cb263ce3a96fa725282d60d (diff)
Merge branch 'master' of https://github.com/okfocus/stone-island
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js')
-rw-r--r--StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js b/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
index 7cd96f89..d06ed590 100644
--- a/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
+++ b/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
@@ -1,7 +1,7 @@
var ScrollableView = View.extend({
events: {
- "load img": "deferScrollToTop",
+ "load img": "deferRefresh",
},
deferScrollToTop: function(){
@@ -10,8 +10,15 @@ var ScrollableView = View.extend({
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)