summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/index/index.js
blob: 840f150323db662381b5e2fd4262a6af40ec875b (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
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, latest: true, welcome: true, })
    this.lastlog = new LastLog ({ parent: this })
    this.load()
  },
  
  load: function(){
    $.get(this.action, this.populate.bind(this))
  },
  
  populate: function(data){
    $("body").removeClass('loading')
    this.hootbox.load(data.hootbox)
    this.threadbox.load(data)
    this.lastlog.load(data.lastlog)
    $("#search_form input").focus()
  },
  
  success: function(){
    window.location.href = "/index"
  },

})