align option for fader
This commit is contained in:
parent
14868f3b78
commit
b06bad1596
4 changed files with 36 additions and 2 deletions
File diff suppressed because one or more lines are too long
|
|
@ -17,6 +17,7 @@ module.exports.options = {
|
|||
top:'auto',
|
||||
width:'auto',
|
||||
height:'auto',
|
||||
align:'center',
|
||||
horizontal:false,
|
||||
color:'auto',
|
||||
css:'',
|
||||
|
|
@ -61,7 +62,12 @@ module.exports.create = function(widgetData,container) {
|
|||
roundFactor = Math.pow(10,widgetData.precision)
|
||||
|
||||
|
||||
if (widgetData.horizontal) container.addClass('horizontal')
|
||||
if (widgetData.horizontal) {
|
||||
container.addClass('horizontal')
|
||||
delete widgetData.align
|
||||
} else {
|
||||
container.addClass('align-'+widgetData.align)
|
||||
}
|
||||
|
||||
handle.size = 0
|
||||
fader.size = 0
|
||||
|
|
|
|||
|
|
@ -3,6 +3,33 @@
|
|||
min-height: 200rem;
|
||||
height:100%;
|
||||
|
||||
&.align-right .fader-wrapper {
|
||||
.fader {
|
||||
margin-left:calc(50% + 15rem);
|
||||
&:before {
|
||||
box-shadow: 20rem 0 0 35rem;
|
||||
}
|
||||
}
|
||||
.meter-container {
|
||||
-webkit-mask:none;
|
||||
right:auto!important;
|
||||
width:1rem;
|
||||
}
|
||||
}
|
||||
&.align-left .fader-wrapper {
|
||||
.fader {
|
||||
margin-right:calc(50% + 15rem);
|
||||
&:before {
|
||||
box-shadow: -20rem 0 0 35rem;
|
||||
}
|
||||
}
|
||||
.meter-container {
|
||||
-webkit-mask:none;
|
||||
left:auto!important;
|
||||
width:1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.input {
|
||||
margin-top:-5rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ Sliders are unidimensional widgets that output one value at a time.
|
|||
```js
|
||||
type:'fader',
|
||||
horizontal:false, // [bool] set to true to display fader horizontally
|
||||
align:'center', // [left|right] only display one scale and one meter
|
||||
range: {"min":0,"max":1}, // [object] defining the breakpoints of the fader
|
||||
// keys can be percentages or 'min' / 'max'
|
||||
logScale: false, // [bool] use logarithmic scale (log10)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue