Bug Tracker

Changeset 4963

Show
Ignore:
Timestamp:
03/15/08 13:40:12 (10 months ago)
Author:
scott.gonzalez
Message:

UI Slider: Fixed #2366 - Proper rounding for stepping values (applied zimbatm's patch).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ui/ui.slider.js

    r4901 r4963  
    164164        value: function(handle) { 
    165165            if(this.handle.length == 1) this.currentHandle = this.handle; 
    166             return ((parseInt($(handle != undefined ? this.handle[handle] || handle : this.currentHandle).css(this.properties[0]),10) / (this.size - this.handleSize())) * this.options.realMaxValue) + this.options.minValue; 
     166            var value = ((parseInt($(handle != undefined ? this.handle[handle] || handle : this.currentHandle).css(this.properties[0]),10) / (this.size - this.handleSize())) * this.options.realMaxValue) + this.options.minValue; 
     167                        var o = this.options; 
     168                        if (o.stepping) { 
     169                            value = Math.round(value / o.stepping) * o.stepping; 
     170                        } 
     171                        return value 
    167172        }, 
    168173        convertValue: function(value) {