range: allow moving the range (both handles) with shift key pressed (issue #114)

This commit is contained in:
bordun 2018-01-31 17:51:32 +01:00
parent 3d2b2e0586
commit fac6992cd5
2 changed files with 7 additions and 2 deletions

View file

@ -249,7 +249,7 @@ An endless knob that only responds to rotative gestures.
## Range
A range is a fader with two handles.
A range is a fader with two handles. To move the range (both handles at once), hold the `shift` key or use two fingers.
```js
{

View file

@ -339,7 +339,12 @@ module.exports = class Range extends _widgets_base {
this.on('drag',(e)=>{
var i = this.touchMap[e.pointerId]
this.faders[i].trigger('drag', [e])
if (e.shiftKey) {
this.faders[0].trigger('drag', [e])
this.faders[1].trigger('drag', [e])
} else {
this.faders[i].trigger('drag', [e])
}
}, {element: this.wrapper, multitouch: true})