summaryrefslogtreecommitdiff
path: root/public/js/lib/views/login.js
blob: 325d22de45f01457542cf1a3984e21ae79c806b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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"
        }
      })
    }
  },
})