Skip to content

Commit

Permalink
Little fixes in slider and remove explicit react dependency from it
Browse files Browse the repository at this point in the history
  • Loading branch information
javivelasco committed Jul 24, 2015
1 parent 8f19493 commit e01babc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions components/slider/index.cjsx
@@ -1,7 +1,5 @@
React = require 'react/addons'
prefixer = require "../prefixer"
localCSS = require './style'

ProgressBar = require "../progress_bar"
Input = require "../input"

Expand Down Expand Up @@ -82,9 +80,9 @@ module.exports = React.createClass

onKeyDown: (event) ->
event.stopPropagation()
@refs.slider.getDOMNode().blur() if event.keyCode in [13, 27]
@addToValue(@props.step) if event.keyCode == 38
@addToValue(-@props.step) if event.keyCode == 40
@getDOMNode().blur() if event.keyCode in [13, 27]
@addToValue(@props.step) if event.keyCode == 38
@addToValue(-@props.step) if event.keyCode == 40

onMouseDown: (event) ->
@start(_getMousePosition(event))
Expand Down Expand Up @@ -122,7 +120,7 @@ module.exports = React.createClass

positionToValue: (position) ->
offset = position.x - @state.sliderStart
@trimValue(offset / @state.sliderLength * (@props.max - @props.min))
@trimValue(offset / @state.sliderLength * (@props.max - @props.min) + @props.min)

start: (position) ->
@setState
Expand Down

0 comments on commit e01babc

Please sign in to comment.