Skip to content

Commit

Permalink
Merge pull request #491 from koenbok/feature/cloud-detect
Browse files Browse the repository at this point in the history
Detect running from Framer Cloud
  • Loading branch information
edwinvanrijkom committed Apr 18, 2017
2 parents 376bc04 + 88cc0c8 commit 2979f9b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion framer/Utils.coffee
Expand Up @@ -673,7 +673,14 @@ Utils.loadImage = (url, callback, context) ->
element.src = url element.src = url


Utils.isInsideIframe = -> 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 # GEOMETRY FUNCTIONS
Expand Down

0 comments on commit 2979f9b

Please sign in to comment.