Last active
August 29, 2015 13:55
-
-
Save uris77/8718111 to your computer and use it in GitHub Desktop.
Suggestion Refactor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Cuda.module "Login", (Login, App, Backbone, Marionette, $, _) -> | |
# Login Form | |
class Login.Form extends Marionette.Layout | |
initialize: (options) -> | |
@model = new Backbone.Model({error: ""}) | |
@model.bind('change', @render) | |
handleSubmit: -> | |
$form = $(e.currentTarget) | |
if $form.data("ajax") | |
@trigger 'submit:form', dataFromForm | |
e.preventDefault() | |
class LoginForm.Controller extends Marionette.Controller | |
initialize: (options) -> | |
@_createLoginForm() | |
# True when we are checking for an existing cas session | |
@isCookieCheck = false | |
# True when user is logged in. Only controlls view. Does not grant any special acess. | |
@isLoggedIn = false | |
_createLoginForm: -> | |
@loginForm = new Login.Form | |
@listenTo @loginForm, 'submt:form', (dataFromForm) => | |
loginController.authenticate(dataForm) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment