From 214adfb45061605f9929e9a26c8a3309641b143c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 15 Oct 2016 01:10:35 +0200 Subject: [PATCH] Rerender on global rerender event. --- app/assets/javascripts/app/controllers/login.coffee | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/login.coffee b/app/assets/javascripts/app/controllers/login.coffee index b5c9e0c9f..ed3c580a8 100644 --- a/app/assets/javascripts/app/controllers/login.coffee +++ b/app/assets/javascripts/app/controllers/login.coffee @@ -33,6 +33,9 @@ class Index extends App.ControllerContent @render() 'rerender' ) + @bind('ui:rerender', => + @render() + ) render: (data = {}) -> auth_provider_all = { @@ -85,10 +88,10 @@ class Index extends App.ControllerContent ) # set focus to username or password - if !$(@el).find('[name="username"]').val() - $(@el).find('[name="username"]').focus() + if !@$('[name="username"]').val() + @$('[name="username"]').focus() else - $(@el).find('[name="password"]').focus() + @$('[name="password"]').focus() # scroll to top @scrollTo() @@ -143,7 +146,7 @@ class Index extends App.ControllerContent # login shake @delay( - => @shake( @el.find('.hero-unit') ), + => @shake( @$('.hero-unit') ) 600 )