Bug Tracker

Ticket #2500 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

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

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

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 Download (1.2 KB) - added by joern 6 years ago.

Change History

Changed 6 years ago by joern

comment:1 Changed 6 years ago by joern

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [4897].

Note: See TracTickets for help on using tickets.