aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-06 06:44:41 +1100
committerfriendica <info@friendica.com>2014-02-06 06:44:41 +1100
commite525f045c1300f0eeb2ad2612ad20c61cc251d48 (patch)
tree77ce785f58b8fe66a139196939cb81731d8dca7e /view
parent4a03ae09ebf1725c282bba5f333f9c76d132e7f0 (diff)
parenta2fa1a162d9526987539479b22a328e5298954e8 (diff)
downloadvolse-hubzilla-e525f045c1300f0eeb2ad2612ad20c61cc251d48.tar.gz
volse-hubzilla-e525f045c1300f0eeb2ad2612ad20c61cc251d48.tar.bz2
volse-hubzilla-e525f045c1300f0eeb2ad2612ad20c61cc251d48.zip
Merge pull request #298 from cvogeley/master
Other not so elegant way of detecting touch screen devices
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 e4cd1d20b..7073a0a52 100644
--- a/view/tpl/chat.tpl
+++ b/view/tpl/chat.tpl
@@ -88,8 +88,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(){