aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorChristian Vogeley <christian.vogeley@hotmail.de>2014-02-02 13:59:20 +0100
committerChristian Vogeley <christian.vogeley@hotmail.de>2014-02-02 13:59:20 +0100
commita2fa1a162d9526987539479b22a328e5298954e8 (patch)
tree7470b7e22fb2f69ce8bc4f6e561ed9711b4eeae6 /view
parent30aeb42bed0b4bb6bf90c16674565ee5d7a26945 (diff)
downloadvolse-hubzilla-a2fa1a162d9526987539479b22a328e5298954e8.tar.gz
volse-hubzilla-a2fa1a162d9526987539479b22a328e5298954e8.tar.bz2
volse-hubzilla-a2fa1a162d9526987539479b22a328e5298954e8.zip
Other not so elegant way of detecting touch screen devices
But at least it seems to work
Diffstat (limited to 'view')
-rw-r--r--view/tpl/chat.tpl15
1 files changed, 13 insertions, 2 deletions
diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl
index a0c18f8d6..5c96e79fe 100644
--- a/view/tpl/chat.tpl
+++ b/view/tpl/chat.tpl
@@ -91,8 +91,19 @@ function update_chats(chats) {
</script>
<script>
function isMobile() {
- try{ document.createEvent("TouchEvent"); return true; }
- catch(e){ return false; }
+if( navigator.userAgent.match(/Android/i)
+ || navigator.userAgent.match(/webOS/i)
+ || navigator.userAgent.match(/iPhone/i)
+ || navigator.userAgent.match(/iPad/i)
+ || navigator.userAgent.match(/iPod/i)
+ || navigator.userAgent.match(/BlackBerry/i)
+ || navigator.userAgent.match(/Windows Phone/i)
+ ){
+ return true;
+ }
+ else {
+ return false;
+ }
}
$(function(){