Permalink
Browse files

Merge pull request #445 from koenbok/fix/constructor-scroll

fix new Layer({scroll:true}), ignoreEvents default was in the way
  • Loading branch information...
nvh committed Jun 15, 2017
2 parents 86844fd + 13dbaf7 commit dc0728f03b81643be73e60a315b79de19a63342a
Showing with 8 additions and 3 deletions.
  1. +3 −3 framer/Layer.coffee
  2. +5 −0 test/tests/LayerTest.coffee
View
@@ -224,6 +224,9 @@ class exports.Layer extends BaseClass
# Default animation options for every animation of this layer
@define "animationOptions", @simpleProperty("animationOptions", {})
# Behaviour properties
@define "ignoreEvents", layerProperty(@, "ignoreEvents", "pointerEvents", true, _.isBoolean)
# Css properties
@define "width", layerProperty(@, "width", "width", 100, _.isNumber, null, {}, (layer, value) ->
return if not layer.constraintValues? or layer.isLayouting
@@ -256,9 +259,6 @@ class exports.Layer extends BaseClass
get: -> @scrollHorizontal is true or @scrollVertical is true
set: (value) -> @scrollHorizontal = @scrollVertical = value
# Behaviour properties
@define "ignoreEvents", layerProperty(@, "ignoreEvents", "pointerEvents", true, _.isBoolean)
# Matrix properties
@define "x", layerProperty(@, "x", "webkitTransform", 0, _.isNumber,
layerPropertyPointTransformer, {depends: ["width", "height"]}, (layer) ->
@@ -436,6 +436,11 @@ describe "Layer", ->
layer.style["overflow"].should.equal "scroll"
layer.ignoreEvents.should.equal false
it "should disable ignore events when scroll is set from constructor", ->
layerA = new Layer
scroll: true
layerA.ignoreEvents.should.equal false
it "should set style properties on create", ->
layer = new Layer backgroundColor: "red"

0 comments on commit dc0728f

Please sign in to comment.