summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
diff options
context:
space:
mode:
authorRene Ae <aehtyb@gmail.com>2015-11-30 15:24:27 -0600
committerRene Ae <aehtyb@gmail.com>2015-11-30 15:24:27 -0600
commit9d0e54228c79d151c30c527ea83efa7479793686 (patch)
tree3baf83427cd61cb1994e8551eefba5cd21d1a65b /StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
parentb208cb0283c23d68e8013c0dd5ddd4e5e6df8950 (diff)
parentd26e72aea3b3127c95c5ba7069c95f73cf52a2fd (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.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js b/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
new file mode 100644
index 00000000..7cd96f89
--- /dev/null
+++ b/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
@@ -0,0 +1,20 @@
+var ScrollableView = View.extend({
+
+ events: {
+ "load img": "deferScrollToTop",
+ },
+
+ deferScrollToTop: function(){
+ setTimeout(this.scrollToTop.bind(this), 0)
+ },
+
+ refreshScroller: function(){
+ this.scroller.refresh()
+ },
+
+ scrollToTop: function(){
+ this.scroller.refresh()
+ app.collection.scroller.scrollTo(0, 0)
+ },
+
+}) \ No newline at end of file