knob/fader: right click / long touch triggers value input focus

This commit is contained in:
jean-emmanuel 2016-04-04 23:58:47 +02:00
parent f0d7e83e92
commit 7dc078cbd4
4 changed files with 33 additions and 1 deletions

View file

@ -148,6 +148,14 @@ module.exports.create = function(widgetData,container) {
widget.updateUi(gauge.size)
})
wrapper.on('mousedown',function(e){
if (e.button==2 && !EDITING) {
e.stopPropagation()
e.preventDefault()
input.focus()
}
})
wrapper.on('mousewheel',function(e){
if (e.originalEvent.wheelDeltaX) return

View file

@ -102,6 +102,14 @@ module.exports.create = function(widgetData,container) {
mask[0].setAttribute('style',`height:${w}px;width:${w}px;padding-bottom:0`)
})
wrapper.on('mousedown',function(e){
if (e.button==2 && !EDITING) {
e.stopPropagation()
e.preventDefault()
input.focus()
}
})
wrapper.on('mousewheel',function(e){
if (e.originalEvent.wheelDeltaX) return

View file

@ -1849,6 +1849,14 @@ module.exports.create = function(widgetData,container) {
widget.updateUi(gauge.size)
})
wrapper.on('mousedown',function(e){
if (e.button==2 && !EDITING) {
e.stopPropagation()
e.preventDefault()
input.focus()
}
})
wrapper.on('mousewheel',function(e){
if (e.originalEvent.wheelDeltaX) return
@ -2097,6 +2105,14 @@ module.exports.create = function(widgetData,container) {
mask[0].setAttribute('style',`height:${w}px;width:${w}px;padding-bottom:0`)
})
wrapper.on('mousedown',function(e){
if (e.button==2 && !EDITING) {
e.stopPropagation()
e.preventDefault()
input.focus()
}
})
wrapper.on('mousewheel',function(e){
if (e.originalEvent.wheelDeltaX) return

View file

@ -31,7 +31,7 @@ Sliders are unidimensional widgets that output one value at a time.
#### `compact`
- type: `boolean`
- default: `false`
- usage: set to `true` to display a compact alternative for the widget. Enables `noPips` and disables mouse/touch focusing on the value display.
- usage: set to `true` to display a compact alternative for the widget. Enables `noPips` and disables default mouse/touch focusing on the value display (right-click/long-touch still triggers it).
#### `range`