var LoginView = View.extend({ el: "#login", events: { "form submit": "save", }, initialize: function(){ this.$el.show() }, save: function(e){ e.preventDefault() user.save() var that = this if (user.username.length) { app.router.route() oktween.add({ obj: this.el.style, from: { opacity: 1 }, to: { opacity: 0 }, duration: 500, finished: function(){ that.el.style.display = "none" } }) } }, })