Skip to main content

Search and Top Navigation

#6193 closed bug (duplicate)

Opened October 18, 2010 11:26AM UTC

Closed October 18, 2010 01:21PM UTC

Last modified October 11, 2012 09:15PM UTC

Only left handle can be dragged, if they have the same value

Reported by: marc_k Owned by:
Priority: major Milestone:
Component: ui.slider Version: 1.8.5
Keywords: Cc:
Blocked by: Blocking:
Description

On a range slider only the position of the left handle can be changed, if both handles are on the same position.

It's better if you change the code at line 284ff

if( o.range === true && this.values(1) === o.min ) {
  index += 1;
  closestHandle = $( this.handles[index] );
}

to this:

if (o.range === true && this.values(0) === this.values(1) && this.values(1) != o.max) {
  if (this.values(1) === o.min || this._valueFromMouse(position) > this.values(1)) {
    index = 1;
    closestHandle = $(this.handles[index]);
  }
}

and change the _normValueFromMouse function to this:

_normValueFromMouse: function( position ) {
  return this._trimAlignValue( this._valueFromMouse(position) );
},

_valueFromMouse: function( position ) {
  var pixelTotal,
    pixelMouse,
    percentMouse,
    valueTotal,
    valueMouse;

  ''(... code from original _normValueFromMouse function ...)''

  valueTotal = this._valueMax() - this._valueMin();
  valueMouse = this._valueMin() + percentMouse * valueTotal;

  return valueMouse;
},
Attachments (0)
Change History (3)

Changed October 18, 2010 01:21PM UTC by scottgonzalez comment:1

See also #3736.

Changed October 18, 2010 01:21PM UTC by scottgonzalez comment:2

resolution: → duplicate
status: newclosed

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:3

milestone: TBD

Milestone TBD deleted