range: per-fader touch event not emitted properly

This commit is contained in:
bordun 2021-02-07 13:54:04 +01:00
parent effa3f5370
commit 9cb50eee57
2 changed files with 7 additions and 2 deletions

View file

@ -138,6 +138,8 @@ class Range extends Fader {
if (!id) return
this.trigger('touch', {stopPropagation: true, touch: [parseInt(id), 1]})
for (var f of this.faders) {
f.percent = clip(f.percent,[
f.valueToPercent(f.rangeValsMin),
@ -157,8 +159,6 @@ class Range extends Fader {
if (!i) return
this.trigger('touch', {stopPropagation: true, touch: [parseInt(i), 1]})
if (e.shiftKey) {
this.faders[0].trigger('drag', e)
this.faders[1].trigger('drag', e)