Permalink
Browse files

Fix importer bug where layer order would get screwed up

  • Loading branch information...
koenbok committed Sep 23, 2014
1 parent 814d193 commit b9ae0ad5a03d1526e65ba8431e2bd23e3c0f088c
Showing with 4 additions and 13 deletions.
  1. +2 −11 framer/Importer.coffee
  2. +2 −2 framer/Layer.coffee
View
@@ -48,18 +48,9 @@ class exports.Importer
importedKey = "#{@paths.documentName}/layers.json.js"
if window.__imported__?.hasOwnProperty importedKey
if window.__imported__?.hasOwnProperty(importedKey)
return window.__imported__[importedKey]
# # For now this does not work in Chrome and we throw an error
# try
# return Framer.Utils.domLoadJSONSync @paths.layerInfo
# catch e
# if Utils.isChrome
# alert ChromeAlert
# else
# throw e
return Framer.Utils.domLoadJSONSync @paths.layerInfo
_createLayer: (info, superLayer) ->
@@ -103,7 +94,7 @@ class exports.Importer
if not layer.image and not info.children.length and not info.maskFrame
layer.frame = new Frame
info.children.reverse().map (info) => @_createLayer info, layer
_.clone(info.children).reverse().map (info) => @_createLayer info, layer
# TODODODODOD
if not layer.image and not info.maskFrame
View
@@ -69,7 +69,7 @@ class exports.Layer extends BaseClass
super options
# Add this layer to the current context
@_context._layerList.push @
@_context._layerList.push(@)
# Keep track of the default values
# @_defaultValues = options._defaultValues
@@ -83,7 +83,6 @@ class exports.Layer extends BaseClass
# Insert the layer into the dom or the superLayer element
if not options.superLayer
@bringToFront()
@_insertElement() if not options.shadow
else
@superLayer = options.superLayer
@@ -340,6 +339,7 @@ class exports.Layer extends BaseClass
@_element = document.createElement "div"
_insertElement: ->
@bringToFront()
@_context.getRootElement().appendChild @_element
destroy: ->

0 comments on commit b9ae0ad

Please sign in to comment.