Permalink
Browse files

slider value change event + shortcut

  • Loading branch information...
J.P.P Treub
J.P.P Treub committed Feb 23, 2016
1 parent b28335d commit 13042bcae94d0ffb08d3adfded3e84268dadcd9f
Showing with 8 additions and 0 deletions.
  1. +8 −0 framer/Components/SliderComponent.coffee
@@ -17,6 +17,8 @@ valueForPoint(<n>)
animateToValue(value, animationOptions={})
"""
Events.SliderValueChange = "sliderValueChange"
class Knob extends Layer
constructor: (options) ->
@@ -235,6 +237,7 @@ class exports.SliderComponent extends Layer
_updateValue: =>
@emit("change:value", @value)
@emit(Events.SliderValueChange, @value)
pointForValue: (value) ->
if @width > @height
@@ -269,3 +272,8 @@ class exports.SliderComponent extends Layer
@knob.on("change:y", @_updateValue)
@knob.animate(animationOptions)
##############################################################
## EVENT HELPERS
onValueChange: (cb) -> @on(Events.SliderValueChange, cb)

0 comments on commit 13042bc

Please sign in to comment.