 
     sortRef = (a,b) ->
       return -1 if a.getData().value < b.getData().value
-      return 1 if a.getData().value > b.getData().value
-      return 0
+      return  1 if a.getData().value > b.getData().value
+      return  0
     @handles.sort sortRef
 
   drawBar:->

    options.drawBar    ?= yes
    options.showLabels ?= yes
    options.snap       ?= yes
    data.handles

    super options, data


    @on "mousedown", ->
      @parent.bindEvent "mousemove"
      windowController.setDragInAction true
      @parent.emit "dragstart"

      @parent.on "mousemove", (event) =>
        relPos  = (((event.pageX - @parent.getX())/@parent.getWidth())*100)
        @setValue ((relPos*(maxValue - minValue))/100)+minValue

        @parent.emit "draginaction"

      @on "mouseup", dragDidEnd
      @parent.on "mouseleave", dragDidEnd

    dragDidEnd =(e) ->
      @off "mouseup"
      @parent.off "mousemove"
      windowController.setDragInAction false
      @snap() if @parent.getOption "snap"
      @parent.emit "dragend"

  getPosition:->
    {maxValue, minValue} = @parent.getOptions()
