Permalink
Browse files

Fix index set at creation

  • Loading branch information...
koenbok committed Feb 15, 2015
1 parent d69bbfe commit efc5aa4810a605f1f9aec43161cce403b3ddd4f4
Showing with 10 additions and 1 deletion.
  1. +5 −1 framer/Layer.coffee
  2. +5 −0 test/tests/LayerTest.coffee
View
@@ -88,7 +88,7 @@ class exports.Layer extends BaseClass
# @_element.id = "FramerLayer-#{@id}"
for k in ["minX", "midX", "maxX", "minY", "midY", "maxY"]
if options.hasOwnProperty k
if options.hasOwnProperty(k)
@[k] = options[k]
# Insert the layer into the dom or the superLayer element
@@ -97,6 +97,10 @@ class exports.Layer extends BaseClass
else
@superLayer = options.superLayer
# If an index was set, we would like to use that one
if options.hasOwnProperty("index")
@index = options.index
# Set needed private variables
@_subLayers = []
@@ -517,6 +517,11 @@ describe "Layer", ->
describe "Layering", ->
it "should set at creation", ->
layer = new Layer index:666
layer.index.should.equal 666
it "should change index", ->
layer = new Layer

0 comments on commit efc5aa4

Please sign in to comment.