- new widget container : panel
- width parameter in px (no more x100 factor)
This commit is contained in:
parent
91896169b9
commit
f9cc812f6b
6 changed files with 103 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue