summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-30 23:19:28 -0500
committerJules Laplace <jules@okfoc.us>2015-11-30 23:19:28 -0500
commitf6e7c07078252d72b0c7725350a83adfff740b99 (patch)
tree41980a23e5e76b4bbdfcee5d039845635003e0df /StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
parent83a884197ff0226631a46e4894f22b8468b15598 (diff)
plugins
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)