compact option for knob + docs about compact

This commit is contained in:
jean-emmanuel 2016-04-04 10:11:30 +02:00
parent 13fd48455f
commit 0a6db1dd7f
5 changed files with 42 additions and 7 deletions

File diff suppressed because one or more lines are too long

View file

@ -18,6 +18,7 @@ module.exports.options = {
height:'auto',
color:'auto',
noPip:false,
compact:true,
css:'',
separator2:'behaviour',
@ -60,7 +61,8 @@ module.exports.create = function(widgetData,container) {
logScale = widgetData.logScale,
roundFactor = Math.pow(10,widgetData.precision)
if (widgetData.noPip) wrapper.addClass('no-pip')
if (widgetData.noPip) wrapper.addClass('no-pip')
if (widgetData.compact) container.addClass('compact')
var rangeKeys = [],

View file

@ -2012,6 +2012,7 @@ module.exports.options = {
height:'auto',
color:'auto',
noPip:false,
compact:true,
css:'',
separator2:'behaviour',
@ -2054,7 +2055,8 @@ module.exports.create = function(widgetData,container) {
logScale = widgetData.logScale,
roundFactor = Math.pow(10,widgetData.precision)
if (widgetData.noPip) wrapper.addClass('no-pip')
if (widgetData.noPip) wrapper.addClass('no-pip')
if (widgetData.compact) container.addClass('compact')
var rangeKeys = [],

View file

@ -12,6 +12,30 @@
margin-top:-5rem;
}
&.compact {
.pips {
display: none;
}
.input {
position: absolute;
top:50%;
margin-top: -15rem;
left:22%;
right:22%;
width:auto;
pointer-events: none;
}
.knob-wrapper-outer {
position: relative;
}
.knob-wrapper {
padding:10% 0!important;
}
.knob:before {
display: none;
}
}
.knob-wrapper-outer {
width: 100%;
display: flex;

View file

@ -28,6 +28,12 @@ Sliders are unidimensional widgets that output one value at a time.
- default: `false`
- usage: set to `true` to hide the scale
#### `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.
#### `range`
- type: `object`
- default: `{"min":0,"max":1}`
@ -42,10 +48,6 @@ range: {
"max": {"inf":10} // "inf" will be used as a custom label on the scale
}
```
#### `horizontal`
- type: `boolean`
- default: `false`
- usage: set to `true` to display the fader horizontally
#### `logScale`
- type: `boolean`
@ -97,6 +99,11 @@ range: {
- default: `false`
- usage: set to `true` to hide the scale
#### `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.
#### `range`
- type: `object`
- default: `{"min":0,"max":1}`