Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Allow non animatable properties in states
Like scroll, backgroundColor etc. Transition will be instant.
- Loading branch information
Showing
with
94 additions
and 16 deletions.
- +10 −12 extras/CactusFramer/static/app.coffee
- +1 −0 framer/Layer.coffee
- +22 −4 framer/LayerStates.coffee
- +53 −0 test/tests/LayerStatesTest.coffee
- +8 −0 test/tests/LayerTest.coffee
@@ -1,15 +1,13 @@ | ||
Framer.Device = new Framer.DeviceView() | ||
Framer.Device.setupContext() | ||
layer = new Layer | ||
layer.states.add | ||
stateA: {backgroundColor:"red", x:500} | ||
|
||
Framer.Device.deviceType = "desktop-browser-1440" | ||
# layer.scroll.should.equal false | ||
# layer.x.should.equal 0 | ||
|
||
f = false | ||
l = new Layer | ||
layer.states.on Events.StateDidSwitch, -> | ||
print "done", layer.backgroundColor | ||
|
||
l.on Events.Click, -> | ||
if f is true | ||
Framer.Device.deviceType = "desktop-browser-1440" | ||
f = false | ||
else | ||
Framer.Device.deviceType = "fullscreen" | ||
f = true | ||
|
||
|
||
layer.states.switch "stateA", {curve:"ease-in-out", time:1} |