Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#2500 closed bug (fixed)

ui.slider - moveTo assumes string-value is always relative

Reported by: joern Owned by: paul
Priority: major Milestone: 1.5
Component: ui.core Version:
Keywords: Cc:
Blocked by: Blocking:

Description

In the current moveTo implementation, if the value is a string, its always handled as a relative value. Instead it should be checked if the value really starts with +=, and applying the relative stuff only then.

This works quite well:

if(value.constructor == String) {
	if (/^\-\=/.test(value) ) {
		value = this.value() - parseInt(value.replace('-=', ''), 10)
	} else if (/^\+\=/.test(value) ) {
		value = this.value() + parseInt(value.replace('+=', ''), 10)
	} else {
		value = parseInt(value, 10);
	}
}

Attachments (1)

ui-slider-moveTo.patch (1.2 KB) - added by joern 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by joern

Attachment: ui-slider-moveTo.patch added

comment:1 Changed 12 years ago by joern

Resolution: fixed
Status: newclosed

Fixed in [4897].

comment:2 Changed 11 years ago by paul

Milestone: 1.5
Note: See TracTickets for help on using tickets.