Permalink
Browse files

Fix device detection

  • Loading branch information...
koenbok committed Mar 10, 2015
1 parent 3b25bba commit e6cd862ada7ec04a20d879c3d40d1cd4c415a417
Showing with 10 additions and 4 deletions.
  1. +7 −1 framer/DeviceView.coffee
  2. +3 −3 framer/Utils.coffee
@@ -155,7 +155,13 @@ class exports.DeviceView extends BaseClass
if @deviceType is "fullscreen"
return true
if Utils.deviceType() is @_device.deviceType
if Utils.deviceType() is "phone" and Utils.deviceType() is @_device.deviceType
return true
if Utils.deviceType() is "tablet" and Utils.deviceType() is @_device.deviceType
return true
if Utils.deviceType() is "phone" and @_device.deviceType is "tablet"
return true
return false
@@ -262,12 +262,12 @@ Utils.deviceType = ->
# Taken from
# https://github.com/jeffmcmahan/device-detective/blob/master/bin/device-detect.js
if /(tablet)|(iPad)|(Nexus 9)/i.test(navigator.userAgent)
return "tablet"
if /(mobi)/i.test(navigator.userAgent)
return "phone"
if /(tablet)|(iPad)/i.test(navigator.userAgent)
return "tablet"
return "desktop"
Utils.pathJoin = ->

0 comments on commit e6cd862

Please sign in to comment.