Bug Tracker

Ticket #2500 (closed bug: fixed)

Opened 6 months ago

Last modified 6 months ago

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

Reported by: joern Assigned to: paul
Type: bug Priority: major
Milestone: Component: ui
Version: Keywords:
Cc: Needs: Test Case

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

ui-slider-moveTo.patch (1.2 kB) - added by joern 6 months ago.

Change History

Changed 6 months ago by joern

Changed 6 months ago by joern

  • status changed from new to closed
  • resolution set to fixed

Fixed in [4897].

Note: See TracTickets for help on using tickets.