diff options
| author | julian laplace <julescarbon@gmail.com> | 2022-10-31 12:00:16 +0100 |
|---|---|---|
| committer | julian laplace <julescarbon@gmail.com> | 2022-10-31 12:00:16 +0100 |
| commit | 341393513dc3622b6d59e5512a7ab11d82c7e6c3 (patch) | |
| tree | 25eac45533edbf406f6afe7adcb707e7ad9726cd /public/assets/js/lib/views | |
| parent | a2bf5ad8689fb0f9c662cf2bb17a6d4890aba349 (diff) | |
redirect to /stream on mobile
Diffstat (limited to 'public/assets/js/lib/views')
| -rw-r--r-- | public/assets/js/lib/views/admin/adminz.js | 52 | ||||
| -rw-r--r-- | public/assets/js/lib/views/index/index.js | 4 | ||||
| -rw-r--r-- | public/assets/js/lib/views/stream/index.js | 4 |
3 files changed, 33 insertions, 27 deletions
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( - "<a href='/mail'>" + - "You have " + - data.mail.count + - " new message" + - courtesy_s(data.mail.count) + - "!</a>") + $(".alert") + .show() + .html( + "<a href='/mail'>" + + "You have " + + data.mail.count + + " new message" + + courtesy_s(data.mail.count) + + "!</a>" + ); if (is_mobile) { - $("#content").prepend( $(".alert") ) + $("#content").prepend($(".alert")); } } - $(".search_form input").focus() + if (is_desktop) { + $(".search_form input").focus(); + } }, - -}) +}); diff --git a/public/assets/js/lib/views/index/index.js b/public/assets/js/lib/views/index/index.js index cd5f650..b370c9e 100644 --- a/public/assets/js/lib/views/index/index.js +++ b/public/assets/js/lib/views/index/index.js @@ -50,7 +50,9 @@ var IndexView = View.extend({ $("#content").prepend($(".alert")); } } - $(".search_form input").focus(); + if (is_desktop) { + $(".search_form input").focus(); + } }, success: function () { diff --git a/public/assets/js/lib/views/stream/index.js b/public/assets/js/lib/views/stream/index.js index 0a2aeb9..fef23ef 100644 --- a/public/assets/js/lib/views/stream/index.js +++ b/public/assets/js/lib/views/stream/index.js @@ -38,7 +38,9 @@ var StreamView = View.extend({ $("#content").prepend($(".alert")); } } - $(".search_form input").focus(); + if (is_desktop) { + $(".search_form input").focus(); + } }, onComment: function (comment) { |
