Permalink
Browse files

Merge pull request #491 from koenbok/feature/cloud-detect

Detect running from Framer Cloud
  • Loading branch information...
edwinvanrijkom committed Apr 18, 2017
2 parents 376bc04 + 88cc0c8 commit 2979f9b41f62c8a850604575a4ea6390628b19e8
Showing with 8 additions and 1 deletion.
  1. +8 −1 framer/Utils.coffee
View
@@ -673,7 +673,14 @@ Utils.loadImage = (url, callback, context) ->
element.src = url
Utils.isInsideIframe = ->
- return window isnt window.top
+ return window isnt window.top unless Utils.isInsideFramerCloud()
+ return false
+
+Utils.isInsideFramerCloud = ->
+ return Utils.getQueryParameters()["cloud"] is "1"
+
+Utils.getQueryParameters = ->
+ return _.fromPairs window.location.search.slice(1).split('&').map((val) -> val.split('='))
######################################################
# GEOMETRY FUNCTIONS

0 comments on commit 2979f9b

Please sign in to comment.