From 10256ddf3b7d65fde443b68d305101c8e7edd5e4 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 8 Jan 2018 15:20:33 +0100 Subject: move the new message alert to the top above thread box on phone --- public/assets/js/lib/views/index/index.js | 3 +++ public/assets/js/vendor/util.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/public/assets/js/lib/views/index/index.js b/public/assets/js/lib/views/index/index.js index edf5483..985f990 100644 --- a/public/assets/js/lib/views/index/index.js +++ b/public/assets/js/lib/views/index/index.js @@ -42,6 +42,9 @@ var IndexView = View.extend({ " new message" + courtesy_s(data.mail.count) + "!") + if (is_mobile) { + $("#content").prepend( $(".alert") ) + } } $(".search_form input").focus() }, diff --git a/public/assets/js/vendor/util.js b/public/assets/js/vendor/util.js index cab7a6c..bcaa2d2 100644 --- a/public/assets/js/vendor/util.js +++ b/public/assets/js/vendor/util.js @@ -277,7 +277,7 @@ if (!Function.prototype.bind) { var is_iphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) var is_ipad = (navigator.userAgent.match(/iPad/i)) var is_android = (navigator.userAgent.match(/Android/i)) -var is_mobile = is_iphone || is_ipad || is_android +var is_mobile = !!( is_iphone || is_ipad || is_android ) var is_desktop = ! is_mobile; var app_devicePixelRatio = is_mobile ? devicePixelRatio : 1; -- cgit v1.2.3-70-g09d2