Created
December 1, 2014 17:03
-
-
Save koenbok/55071e29e8bde99a7ad0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Utils.globalLayers = (importedLayers) -> | |
| for layerName, layer of importedLayers | |
| # Replace all whitespace in layer names | |
| layerName = layerName.replace(/\s/g,"") | |
| # Check if there are global variables with the same name | |
| if window.hasOwnProperty(layerName) and not window.Framer._globalWarningGiven | |
| print "Warning: Cannot make layer '#{layerName}' a global, an variable with that name already exists" | |
| else | |
| window[layerName] = layer | |
| window.Framer._globalWarningGiven = true | |
| Utils.globalLayers(androidLayers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment