Merge pull request #298 from cvogeley/master

Other not so elegant way of detecting touch screen devices
This commit is contained in:
friendica 2014-02-06 06:44:41 +11:00
commit e525f045c1

View File

@ -88,8 +88,19 @@ function update_chats(chats) {
</script> </script>
<script> <script>
function isMobile() { function isMobile() {
try{ document.createEvent("TouchEvent"); return true; } if( navigator.userAgent.match(/Android/i)
catch(e){ return false; } || 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(){ $(function(){