Skip to content

Commit

Permalink
Added bounds to the slider rage, fix for bug prajwalkman#50
Browse files Browse the repository at this point in the history
  • Loading branch information
azadorozhniy committed Dec 17, 2013
1 parent e926b07 commit 402dff4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/angular-slider.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@ sliderDirective = ($timeout) ->
newOffset = eventX - element[0].getBoundingClientRect().left - pointerHalfWidth
newOffset = Math.max(Math.min(newOffset, maxOffset), minOffset)
newPercent = percentOffset newOffset
newValue = minValue + (valueRange * newPercent / 100.0)
newValue = Math.round(minValue + (valueRange * newPercent / 100.0))
if range
if ref is refLow
if newValue > scope[refHigh]
if newValue >= scope[refHigh]
ref = refHigh
minPtr.removeClass 'active'
maxPtr.addClass 'active'
else
if newValue < scope[refLow]
if newValue <= scope[refLow]
ref = refLow
maxPtr.removeClass 'active'
minPtr.addClass 'active'
Expand Down

0 comments on commit 402dff4

Please sign in to comment.