var AdminView = View.extend({ events: {}, action: "/api/admin", initialize: function (opt) { // this.hootbox = new HootBox ({ parent: this }) this.password = new ChangePasswordForm({ parent: this }); this.lastlog = new LastLog({ parent: this }); }, load: function () { $("body").addClass("index").addClass("admin"); $.get(this.action, this.populate.bind(this)); }, populate: function (data) { $("body").removeClass("loading"); console.log(data); this.password.load(data.usernames); this.lastlog.load(data.lastlog); if (data.mail.count) { $(".alert") .show() .html( "" + "You have " + data.mail.count + " new message" + courtesy_s(data.mail.count) + "!" ); if (is_mobile) { $("#content").prepend($(".alert")); } } if (is_desktop) { // $(".search_form input").focus(); } }, });