fader: smart height/width for 'auto' (expand from top/left to bottom/right)
This commit is contained in:
parent
624738c9d0
commit
00c89c5cb1
3 changed files with 13 additions and 3 deletions
|
|
@ -39,7 +39,7 @@ module.exports.options = {
|
|||
target:[]
|
||||
}
|
||||
|
||||
var Fader = module.exports.Fader = function(widgetData){
|
||||
var Fader = module.exports.Fader = function(widgetData, container){
|
||||
|
||||
_sliders_base.apply(this,arguments)
|
||||
this.widget.addClass('fader')
|
||||
|
|
@ -47,7 +47,14 @@ var Fader = module.exports.Fader = function(widgetData){
|
|||
|
||||
|
||||
if (widgetData.horizontal) {
|
||||
this.widget.addClass('horizontal')
|
||||
container.add(this.widget).addClass('horizontal')
|
||||
if (widgetData.width == 'auto' && widgetData.left != 'auto') {
|
||||
container.css({'width':'auto', 'right':'0'})
|
||||
}
|
||||
} else {
|
||||
if (widgetData.height == 'auto' && widgetData.top != 'auto') {
|
||||
container.css({'height':'auto', 'bottom':'0'})
|
||||
}
|
||||
}
|
||||
|
||||
if (widgetData.compact) {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
--color-pips: var(--color-text-fade);
|
||||
--color-gauge: var(--color-custom);
|
||||
--color-knob: var(--color-custom);
|
||||
height:100%;
|
||||
width:100rem;
|
||||
&.horizontal {
|
||||
height:130rem;
|
||||
}
|
||||
}
|
||||
|
||||
.fader {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue