Permalink
Browse files

Fix device images for file urls

  • Loading branch information...
koenbok committed Jul 28, 2016
1 parent 04a5d8c commit 4daa11bbcbfb07dc280c5cdc620921e4ed779558
Showing with 8 additions and 0 deletions.
  1. +8 −0 framer/Components/DeviceComponent.coffee
@@ -305,6 +305,10 @@ class exports.DeviceComponent extends BaseClass
# We want to get these image from our public resources server
resourceUrl = "//resources.framerjs.com/static/DeviceResources"
+ # If we are running a local copy of Framer from the drive, get the resource online
+ if Utils.isFileUrl(window.location.href)
+ resourceUrl = "http://#{resourceUrl}"
+
# If we're running Framer Studio and have local files, we'd like to use those.
# For now we always use jp2 inside framer stusio
if Utils.isFramerStudio() and window.FramerStudioInfo
@@ -560,6 +564,10 @@ class exports.DeviceComponent extends BaseClass
# We want to get these image from our public resources server
resourceUrl = "//resources.framerjs.com/static/DeviceResources"
+ # If we are running a local copy of Framer from the drive, get the resource online
+ if Utils.isFileUrl(window.location.href)
+ resourceUrl = "http://#{resourceUrl}"
+
# If we're running Framer Studio and have local files, we'd like to use those
if Utils.isFramerStudio() and window.FramerStudioInfo and Utils.framerStudioVersion() >= newDeviceMinVersion
resourceUrl = window.FramerStudioInfo.deviceImagesUrl

0 comments on commit 4daa11b

Please sign in to comment.