switch: allow resubmitting the same value
This commit is contained in:
parent
3ed11f3894
commit
e87891cb7c
2 changed files with 6 additions and 3 deletions
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
- widgets
|
||||
- dropdown: allow resubmitting the same value
|
||||
- switch: allow resubmitting the same value
|
||||
- plot: missing `logScaleX` and `logScaleY` properties
|
||||
- xy/multixy: add `axisLock` property; allow locking one the axis by holding `Shift` while dragging if `axisLock` is not set, bypasses it otherwise.
|
||||
- knob/fader/range: add `colorKnob` property
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class Switch extends MenuBase {
|
|||
this.parseValues()
|
||||
|
||||
|
||||
var dragCallback = (e, touchFix)=>{
|
||||
var dragCallback = (e, slide)=>{
|
||||
|
||||
var index = 0,
|
||||
node = e.target
|
||||
|
|
@ -66,7 +66,7 @@ class Switch extends MenuBase {
|
|||
node = e.firstTarget
|
||||
}
|
||||
|
||||
if (touchFix && e.isTouch) {
|
||||
if (slide && e.isTouch) {
|
||||
// special traversing touch fix
|
||||
node = document.elementFromPoint(e.clientX, e.clientY)
|
||||
}
|
||||
|
|
@ -81,7 +81,9 @@ class Switch extends MenuBase {
|
|||
|
||||
var value = this.values[index]
|
||||
|
||||
if (value !== this.value || this.value === undefined) this.setValue(value, {sync: true, send: true})
|
||||
if (slide && value === this.value) return
|
||||
|
||||
this.setValue(value, {sync: true, send: true})
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue