Bug Tracker

Changeset 5400

Show
Ignore:
Timestamp:
05/04/08 08:15:30 (8 months ago)
Author:
paul.bakaus
Message:

ui-slider: use offsetWidth/height in handleSize for now (this makes performance dramatically better), initBoundaries for steps, steps with numeric value works again

Files:
1 modified

Legend:

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

    r5396 r5400  
    2323            this.element.bind("setData.slider", function(event, key, value) { 
    2424                self.options[key] = value; 
    25                 if (/min|max/.test(key)) 
     25                if (/min|max|steps/.test(key)) 
    2626                    self.initBoundaries(); 
    2727            }).bind("getData.slider", function(event, key){ 
     
    106106            //Calculate stepping based on steps 
    107107            o.stepping = { 
    108                 x: o.stepping && o.stepping.x || parseInt(o.stepping, 10) || (o.steps && o.steps.x ? o.realMax.x/o.steps.x : 0), 
    109                 y: o.stepping && o.stepping.y || parseInt(o.stepping, 10) || (o.steps && o.steps.y ? o.realMax.y/o.steps.y : 0) 
     108                x: o.stepping && o.stepping.x || parseInt(o.stepping, 10) || (o.steps ? o.realMax.x/(o.steps.x || parseInt(o.steps, 10) || o.realMax.x) : 0), 
     109                y: o.stepping && o.stepping.y || parseInt(o.stepping, 10) || (o.steps ? o.realMax.y/(o.steps.y || parseInt(o.steps, 10) || o.realMax.y) : 0) 
    110110            }; 
    111111        }, 
     
    189189        handleSize: function(handle,axis) { 
    190190            if(!axis) axis = this.options.axis == "vertical" ? 2 : 1; 
    191             return $(handle != undefined && handle !== null ? this.handle[handle] : this.currentHandle)[axis == 1 ? "outerWidth" : "outerHeight"]();     
     191            return $(handle != undefined && handle !== null ? this.handle[handle] : this.currentHandle)[0][axis == 1 ? "offsetWidth" : "offsetHeight"];  
    192192        }, 
    193193        click: function(e) {