summaryrefslogtreecommitdiff
path: root/public/js/lib/views/login.js
blob: 280f051f20d9aff667cc20949d139e0fc9e4b194 (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
30
31
32
33
var LoginView = View.extend({

  el: "#login",
  
  events: { 
    "submit form": "save",
  },
  
  initialize: function(){
    this.$el.show()
    this.$username = this.$("#username")
    this.$username.focus()
    console.log(this.$username)
  },
  
  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"
        }
      })
    }
  },
})