var IndexView = View.extend({ events: { }, action: "/api/index", keywordAction: "/api/keyword/", 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 }) }, load: function(keyword){ if (keyword) { $(".subtitle").html('< Home') this.threadbox.options.welcome = false $.get(this.keywordAction + keyword, this.populate.bind(this)) } else { $.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" }, })