Last active
August 29, 2015 13:57
-
-
Save micahroberson/9420417 to your computer and use it in GitHub Desktop.
Backbone Layout Manager View
This file contains 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
define [ | |
'jquery' | |
'underscore' | |
'backbone' | |
'models/session' | |
'text!templates/sessions/new.html' | |
], ($, _, Backbone, Session, template) -> | |
SessionsNewView = Backbone.View.extend | |
template: _.template(template) | |
events: | |
'submit form' : 'signIn' | |
initialize: () -> | |
@listenTo Session, 'change:authorized', () -> | |
Backbone.history.navigate '/', true | |
signIn: (e) -> | |
e.stopPropagation() | |
e.preventDefault() | |
Session.signIn | |
email: @$('.email').val() | |
password: @$('.password').val() | |
serialize: () -> | |
testvar: "TESTVAR" | |
beforeRender: () -> | |
console.log "BEFORE" | |
afterRender: () -> | |
console.log "AFTER" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment