summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/view/Scrollable.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/view/Scrollable.js')
-rw-r--r--StoneIsland/www/js/lib/view/Scrollable.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/view/Scrollable.js b/StoneIsland/www/js/lib/view/Scrollable.js
index 7cd96f89..d06ed590 100644
--- a/StoneIsland/www/js/lib/view/Scrollable.js
+++ b/StoneIsland/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)