diff --git a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee index 9c9e5aa0b..ca8455b2e 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee @@ -623,10 +623,10 @@ class App.ControllerForm extends App.Controller @enable: (form) -> - App.Log.log 'ControllerForm', 'notice', 'enable...', $(form).parent() - $(form).parent().find('button').attr('disabled', false) - $(form).parent().find('[type="submit"]').attr('disabled', false) - $(form).parent().find('[type="reset"]').attr('disabled', false) + App.Log.log 'ControllerForm', 'notice', 'enable...', $(form.target).parent() + $(form.target).parent().find('button').attr('disabled', false) + $(form.target).parent().find('[type="submit"]').attr('disabled', false) + $(form.target).parent().find('[type="reset"]').attr('disabled', false) @validate: (data) -> diff --git a/app/assets/javascripts/app/controllers/login.js.coffee b/app/assets/javascripts/app/controllers/login.js.coffee index 3f673c8c9..55b62b5c8 100644 --- a/app/assets/javascripts/app/controllers/login.js.coffee +++ b/app/assets/javascripts/app/controllers/login.js.coffee @@ -54,6 +54,7 @@ class Index extends App.Controller login: (e) -> e.preventDefault() + @formDisable(e) params = @formParam(e.target) # remember username diff --git a/app/assets/javascripts/app/controllers/signup.js.coffee b/app/assets/javascripts/app/controllers/signup.js.coffee index 62d58b543..314440c56 100644 --- a/app/assets/javascripts/app/controllers/signup.js.coffee +++ b/app/assets/javascripts/app/controllers/signup.js.coffee @@ -27,18 +27,18 @@ class Index extends App.Controller @html App.view('signup')() new App.ControllerForm( - el: @el.find('#form-signup'), - model: App.User, - required: 'signup', - autofocus: true, + el: @el.find('#form-signup') + model: App.User + required: 'signup' + autofocus: true ) cancel: -> @navigate 'login' submit: (e) -> - @log 'submit' e.preventDefault() + @formDisable(e) @params = @formParam(e.target) # if no login is given, use emails as fallback @@ -54,18 +54,18 @@ class Index extends App.Controller if errors @log 'error new', errors @formValidate( form: e.target, errors: errors ) + @formEnable(e) return false # save user user.save( success: (r) => App.Auth.login( - data: { - username: @params.login, - password: @params.password, - }, + data: + username: @params.login + password: @params.password success: @success - error: @error, + error: @error ) # error: => # @modalHide() @@ -90,13 +90,13 @@ class Index extends App.Controller # add notify App.Event.trigger 'notify:removeall' App.Event.trigger 'notify', { - type: 'warning', - msg: 'Wrong Username and Password combination.', + type: 'warning' + msg: 'Wrong Username and Password combination.' } # rerender login page @render( - msg: 'Wrong Username and Password combination.', + msg: 'Wrong Username and Password combination.' username: @username ) diff --git a/app/assets/javascripts/app/views/login.jst.eco b/app/assets/javascripts/app/views/login.jst.eco index 47588490b..b22332575 100644 --- a/app/assets/javascripts/app/views/login.jst.eco +++ b/app/assets/javascripts/app/views/login.jst.eco @@ -7,7 +7,7 @@

<%- @T( 'Sign in with' ) %>

-