- new widget container : panel

- width parameter in px (no more x100 factor)
This commit is contained in:
jean-emmanuel 2015-09-25 11:46:41 +02:00
parent 91896169b9
commit f9cc812f6b
6 changed files with 103 additions and 5 deletions

File diff suppressed because one or more lines are too long

View file

@ -64,8 +64,8 @@ parsewidgets = function(widgets,parent) {
var id = widgetData.id,
label = widgetData.label || id,
path = widgetData.path || '/' + id,
width = clip(parseInt(widgetData.width),[1,20]),
style= widgetData.width?`width:${width*100}rem;min-width:${width*100}rem`:''
width = clip(parseInt(widgetData.width),[100,2000]),
style= widgetData.width?`width:${width}rem;min-width:${width}rem`:''
widgetData.path = path
widgetData.target = widgetData.target?(Array.isArray(widgetData.target)?widgetData.target:[widgetData.target]):false

View file

@ -16,6 +16,33 @@ createWidget.strip = function(widgetData,container) {
}
createWidget.panel = function(widgetData,container) {
var widget = $(`
<div class="panel">
</div>
`),
left = parseInt(widgetData.left) || 'auto',
top = parseInt(widgetData.top) || 'auto',
width = parseInt(widgetData.width) || 'auto',
height = parseInt(widgetData.height) || 'auto'
container.css({
left:parseInt(widgetData.left)+'rem',
top:parseInt(widgetData.top)+'rem',
width:parseInt(widgetData.width)+'rem',
height:parseInt(widgetData.height)+'rem',
'min-width':''
})
parsewidgets(widgetData.widgets,widget)
widget.getValue = function(){return}
widget.setValue = function(){return}
return widget
}
createWidget.led = function(widgetData) {
var widget = $(`
<div class="led">

View file

@ -545,6 +545,7 @@ form {
.tab {
display:none;
overflow: auto;
position: relative;
&.on {
display: block;
height:100%;
@ -565,12 +566,13 @@ form {
font-size:13rem;
padding:35rem 0 0;
vertical-align:top;
border: 6rem solid $color-fg;
border: 6rem solid transparent;
border-width:6rem 0;
margin:0 3rem;
box-shadow: 0 0 0 1px $color-bg inset;
background:$bg-3d;
background-clip:padding-box;
&:first-child {
margin-left:6rem;
@ -703,6 +705,22 @@ form {
.panel-container {
position: absolute;
margin:0!important;
border-top:0;
z-index: 2;
.panel {
height:100%;
padding:6rem 0;
> .widget {
border:0;
}
}
}
/* BUTTONS */