height option for every widget & code cleanup
This commit is contained in:
parent
3f1d27327b
commit
6fc48a66c3
5 changed files with 85 additions and 72 deletions
|
|
@ -7,6 +7,11 @@ init = function(session,callback) {
|
|||
// create sidepanel
|
||||
|
||||
$('#sidepanel').append(createMenu([
|
||||
{
|
||||
label:'Fullscreen (F11)',
|
||||
click:toggleFullscreen,
|
||||
icon:'tv'
|
||||
},
|
||||
{
|
||||
html: `
|
||||
<div class="btn">
|
||||
|
|
@ -24,11 +29,6 @@ init = function(session,callback) {
|
|||
|
||||
`
|
||||
},
|
||||
{
|
||||
label:'Fullscreen (F11)',
|
||||
click:toggleFullscreen,
|
||||
icon:'tv'
|
||||
},
|
||||
{
|
||||
html:`<div class="editor btn">
|
||||
<div class="title"><i class="fa fa-edit"></i> Session editor</div>
|
||||
|
|
@ -38,7 +38,7 @@ init = function(session,callback) {
|
|||
<a class="editor-root btn disabled">Root</a>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<a class="editor-import btn" data-action="sessionBrowse">Open</a>
|
||||
<a class="editor-import btn" data-action="sessionBrowse">Load</a>
|
||||
<a class="editor-export btn" data-action="sessionSave">Save</a>
|
||||
</div>
|
||||
<div class="editor-container"></div>
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ parsewidgets = function(widgets,parent) {
|
|||
|
||||
var width = parseInt(widgetData.width)==widgetData.width?parseInt(widgetData.width)+'rem' : widgetData.width,
|
||||
height = parseInt(widgetData.height)==widgetData.height?parseInt(widgetData.height)+'rem' : widgetData.height,
|
||||
styleW = widgetData.width!='auto'?`width:${width};min-width:${width}`:'',
|
||||
styleH = widgetData.height!='auto'?`height:${height};min-height:${height}`:'',
|
||||
styleW = widgetData.width&&widgetData.width!='auto'?`width:${width};min-width:${width}`:'',
|
||||
styleH = widgetData.height&&widgetData.height!='auto'?`height:${height};min-height:${height}`:'',
|
||||
style = styleW + ';' + styleH
|
||||
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ parsewidgets = function(widgets,parent) {
|
|||
|
||||
|
||||
var widgetContainer = $(`
|
||||
<div class="widget ${widgetData.type}-container" widgetType="${widgetData.type}" widgetId="${widgetData.id}" path="${widgetData.path}" style="${style}">
|
||||
<div class="widget ${widgetData.type}-container" style="${style}">
|
||||
<div class="label"><span>${widgetData.label}</span></div>
|
||||
</div>
|
||||
`)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ widgetOptions = {
|
|||
label:'auto',
|
||||
horizontal:false,
|
||||
width:'auto',
|
||||
height:'auto',
|
||||
widgets:[]
|
||||
},
|
||||
panel: {
|
||||
|
|
@ -22,6 +23,7 @@ widgetOptions = {
|
|||
label:'auto',
|
||||
color:'green',
|
||||
width:'auto',
|
||||
height:'auto',
|
||||
range:{min:0,max:1},
|
||||
path:'auto'
|
||||
},
|
||||
|
|
@ -29,6 +31,7 @@ widgetOptions = {
|
|||
id:'auto',
|
||||
label:'auto',
|
||||
width:'auto',
|
||||
height:'auto',
|
||||
off:0,
|
||||
on:1,
|
||||
path:'auto',
|
||||
|
|
@ -38,6 +41,8 @@ widgetOptions = {
|
|||
id:'auto',
|
||||
label:'auto',
|
||||
width:'auto',
|
||||
height:'auto',
|
||||
horizontal:false,
|
||||
values:[0,1],
|
||||
path:'auto',
|
||||
target:false
|
||||
|
|
@ -67,6 +72,7 @@ widgetOptions = {
|
|||
id:'auto',
|
||||
label:'auto',
|
||||
width:'auto',
|
||||
height:'auto',
|
||||
horizontal:false,
|
||||
range:{min:0,max:1},
|
||||
absolute:false,
|
||||
|
|
@ -77,6 +83,7 @@ widgetOptions = {
|
|||
id:'auto',
|
||||
label:'auto',
|
||||
width:'auto',
|
||||
height:'auto',
|
||||
range:{min:0,max:1},
|
||||
absolute:false,
|
||||
pan:false,
|
||||
|
|
@ -212,6 +219,10 @@ createWidget.switch = function(widgetData) {
|
|||
</div>
|
||||
`)
|
||||
|
||||
if (widgetData.horizontal) {
|
||||
widget.addClass('horizontal')
|
||||
}
|
||||
|
||||
for (v in widgetData.values) {
|
||||
widget.append('<div class="value" data-value="'+widgetData.values[v]+'">'+widgetData.values[v]+'</div>')
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue