Bug Tracker

Ticket #2500: ui-slider-moveTo.patch

File ui-slider-moveTo.patch, 1.2 kB (added by joern, 10 months ago)
  • ui/ui.slider.js

     
    237237            if(handle == undefined && !this.currentHandle && this.handle.length != 1) return false; //If no handle has been passed, no current handle is available and we have multiple handles, return false 
    238238            if(handle == undefined && !this.currentHandle) handle = 0; //If only one handle is available, use it 
    239239            if(handle != undefined) this.currentHandle = this.previousHandle = $(this.handle[handle] || handle); 
    240  
    241             if(value.constructor == String) value = /\-\=/.test(value) ? this.value() - parseInt(value.replace('-=', ''),10) : this.value() + parseInt(value.replace('+=', ''),10); 
     240     
     241            if(value.constructor == String) { 
     242                if (/^\-\=/.test(value) ) { 
     243                    value = this.value() - parseInt(value.replace('-=', ''), 10) 
     244                } else if (/^\+\=/.test(value) ) { 
     245                    value = this.value() + parseInt(value.replace('+=', ''), 10) 
     246                } else { 
     247                    value = parseInt(value, 10); 
     248                } 
     249            } 
     250             
    242251            if(o.stepping) value = Math.round(value / o.stepping) * o.stepping; 
    243252            value = this.translateValue(value); 
    244253