From 8a5ff6067748ad1842aca22bf0ab0d9b9a8a72ea Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 20 Apr 2012 18:12:58 +0200 Subject: [PATCH] Added @scrollTo(). --- .../app/controllers/_application_controller.js.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/app/controllers/_application_controller.js.coffee b/app/assets/javascripts/app/controllers/_application_controller.js.coffee index 2ed5cf323..f48ddcb05 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.js.coffee @@ -12,6 +12,12 @@ class App.Controller extends Spine.Controller navupdate: (url) -> Spine.trigger 'navupdate', url + scrollTo: ( x = 0, y = 0 ) -> + a = -> + window.scrollTo( 0,0 ) + + @delay( a, 0 ) + # # extend delegateEvents to unbind and undelegate # delegateEvents: -> #