summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/index/index.js
blob: a1e8af5c827a7eb1a0711be270f9be7e5e7e00b4 (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
var IndexView = View.extend({

  events: {
  },
  
  action: "/api/index",
  
  initialize: function(opt){
    // opt.parent = parent
    this.hootbox = new HootBox ({ parent: this })
    this.threadbox = new ThreadBox ({ parent: this })
    this.lastlog = new LastLog ({ parent: this })
    this.load()
  },
  
  load: function(){
    $.get(this.action, this.populate.bind(this))
  },
  
  populate: function(data){
    this.hootbox.load(data.hootbox)
    this.threadbox.load(data)
    this.lastlog.load(data.lastlog)
  },
  
  success: function(){
    window.location.href = "/index"
  },

})