From f6e7c07078252d72b0c7725350a83adfff740b99 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 30 Nov 2015 23:19:28 -0500 Subject: plugins --- StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'StoneIsland/platforms/ios/www/js/lib/view') 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) -- cgit v1.2.3-70-g09d2