From 341393513dc3622b6d59e5512a7ab11d82c7e6c3 Mon Sep 17 00:00:00 2001 From: julian laplace Date: Mon, 31 Oct 2022 12:00:16 +0100 Subject: redirect to /stream on mobile --- public/assets/js/lib/views/admin/adminz.js | 52 ++++++++++++++++-------------- 1 file changed, 27 insertions(+), 25 deletions(-) (limited to 'public/assets/js/lib/views/admin/adminz.js') diff --git a/public/assets/js/lib/views/admin/adminz.js b/public/assets/js/lib/views/admin/adminz.js index caed86d..cd0c93d 100644 --- a/public/assets/js/lib/views/admin/adminz.js +++ b/public/assets/js/lib/views/admin/adminz.js @@ -1,39 +1,41 @@ var AdminView = View.extend({ - - events: { - }, + events: {}, action: "/api/admin", - initialize: function(opt){ + initialize: function (opt) { // this.hootbox = new HootBox ({ parent: this }) - this.password = new ChangePasswordForm ({ parent: this }) - this.lastlog = new LastLog ({ 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)) + 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) + 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) + - "!") + $(".alert") + .show() + .html( + "" + + "You have " + + data.mail.count + + " new message" + + courtesy_s(data.mail.count) + + "!" + ); if (is_mobile) { - $("#content").prepend( $(".alert") ) + $("#content").prepend($(".alert")); } } - $(".search_form input").focus() + if (is_desktop) { + $(".search_form input").focus(); + } }, - -}) +}); -- cgit v1.2.3-70-g09d2