Merge branch 'master' of github.com:jean-emmanuel/open-stage-control
This commit is contained in:
commit
50cb3c429f
14 changed files with 114 additions and 62 deletions
|
|
@ -52,7 +52,7 @@ class Editor {
|
|||
this.widgetTree.on('sorted', (event)=>{
|
||||
|
||||
var {widget, oldIndex, newIndex} = event,
|
||||
propName = widget.props.tabs.length ? 'tabs' : 'widgets'
|
||||
propName = widget.props.tabs && widget.props.tabs.length ? 'tabs' : 'widgets'
|
||||
|
||||
if (widget.props[propName].length < 2) return
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ class Editor {
|
|||
|
||||
handleKeyboard(combo, e){
|
||||
|
||||
if (e.target && (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.tagName === 'SELECT')) return
|
||||
if (this.inspector.helpModalOpened || e.target && (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.tagName === 'SELECT')) return
|
||||
|
||||
e.preventDefault()
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ class UiDragResize extends UiWidget {
|
|||
this.width = 0
|
||||
this.height = 0
|
||||
|
||||
this.widgets = []
|
||||
this.mounted = false
|
||||
|
||||
this.handles = DOM.get(this.container, '.handle')
|
||||
|
|
@ -94,6 +95,10 @@ class UiDragResize extends UiWidget {
|
|||
|
||||
}, {element: this.container})
|
||||
|
||||
window.addEventListener('resize', ()=>{
|
||||
if (this.mounted) this.updateRectangle()
|
||||
})
|
||||
|
||||
// this.handles[0]._ignore_css_transforms = true
|
||||
|
||||
}
|
||||
|
|
@ -104,6 +109,7 @@ class UiDragResize extends UiWidget {
|
|||
|
||||
this.container.parentNode.removeChild(this.container)
|
||||
this.mounted = false
|
||||
this.widgets = []
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -112,11 +118,22 @@ class UiDragResize extends UiWidget {
|
|||
|
||||
this.clear()
|
||||
|
||||
widgets = widgets.slice().filter(w=>w.getProp('visible') && !(w instanceof Tab) && !(w instanceof Root))
|
||||
this.widgets = widgets.slice().filter(w=>w.getProp('visible') && !(w instanceof Tab) && !(w instanceof Root))
|
||||
|
||||
if (!widgets.length) return
|
||||
if (!this.widgets.length) return
|
||||
|
||||
var widget = widgets[0]
|
||||
this.updateRectangle()
|
||||
|
||||
this.widgets[0].parentNode.appendChild(this.container)
|
||||
this.mounted = true
|
||||
|
||||
|
||||
}
|
||||
|
||||
updateRectangle() {
|
||||
|
||||
var widgets = this.widgets,
|
||||
widget = widgets[0]
|
||||
|
||||
var handlesVisibility = [
|
||||
widget.parent.getProp('layout') === 'default', // nw
|
||||
|
|
@ -129,8 +146,7 @@ class UiDragResize extends UiWidget {
|
|||
this.handles[i].style.display = handlesVisibility[i] ? '' : 'none'
|
||||
}
|
||||
|
||||
var parent = widget.parentNode,
|
||||
lefts = widgets.map(w => w.container.offsetLeft),
|
||||
var lefts = widgets.map(w => w.container.offsetLeft),
|
||||
tops = widgets.map(w => w.container.offsetTop),
|
||||
rights = widgets.map(w => w.container.offsetLeft + w.container.offsetWidth),
|
||||
bottoms = widgets.map(w => w.container.offsetTop + w.container.offsetHeight)
|
||||
|
|
@ -145,9 +161,6 @@ class UiDragResize extends UiWidget {
|
|||
|
||||
this.updateCss()
|
||||
|
||||
parent.appendChild(this.container)
|
||||
this.mounted = true
|
||||
|
||||
}
|
||||
|
||||
updateCss(grid) {
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ class UiInspector extends UiWidget {
|
|||
this.lock = false
|
||||
this.clearTimeout = null
|
||||
|
||||
this.helpModalOpened = false
|
||||
|
||||
}
|
||||
|
||||
clear() {
|
||||
|
|
@ -269,7 +271,7 @@ class UiInspector extends UiWidget {
|
|||
computedValue = JSON.stringify(computedValue, null, ' ')
|
||||
}
|
||||
|
||||
new UiModal({closable: true, title: html`<span class="editor-help-title">${name}</span>`, html: true, content: html`
|
||||
var modal = new UiModal({closable: true, title: html`<span class="editor-help-title">${name}</span>`, html: true, content: html`
|
||||
<div class="inspector-help">
|
||||
|
||||
<div class="header">
|
||||
|
|
@ -291,6 +293,12 @@ class UiInspector extends UiWidget {
|
|||
</div>
|
||||
`})
|
||||
|
||||
|
||||
this.helpModalOpened = true
|
||||
modal.on('close', ()=>{
|
||||
this.helpModalOpened = false
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,14 +142,14 @@ var menuEntries = [
|
|||
label: locales('editor_grid'),
|
||||
class: ()=>{return 'toggle ' + (editor.grid ? 'on' : 'off')},
|
||||
action: editor.toggleGrid.bind(editor),
|
||||
// shortcut: 'mod + g'
|
||||
shortcut: 'mod + g'
|
||||
|
||||
},
|
||||
{
|
||||
label: locales('editor_tree'),
|
||||
class: ()=>{return 'toggle ' + (leftUiSidePanel.minimized ? 'off' : 'on')},
|
||||
action: ()=>{return leftUiSidePanel.minimized ? leftUiSidePanel.restore() : leftUiSidePanel.minimize()},
|
||||
// shortcut: 'mod + t'
|
||||
shortcut: 'mod + t'
|
||||
|
||||
|
||||
},
|
||||
|
|
@ -157,7 +157,7 @@ var menuEntries = [
|
|||
label: locales('editor_inspector'),
|
||||
class: ()=>{return 'toggle ' + (rightUiSidePanel.minimized ? 'off' : 'on')},
|
||||
action: ()=>{return rightUiSidePanel.minimized ? rightUiSidePanel.restore() : rightUiSidePanel.minimize()},
|
||||
// shortcut: 'mod + i'
|
||||
shortcut: 'mod + i'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -116,6 +116,14 @@ class Switch extends MenuBase {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
setCssVariables() {
|
||||
|
||||
super.setCssVariables()
|
||||
|
||||
this.container.classList.toggle('padding-0', this.getProp('padding') === -1)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Switch.cssVariables = Switch.prototype.constructor.cssVariables.concat(
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class ScriptVm extends Vm {
|
|||
|
||||
filter = Array.isArray(filter) ? filter : [filter]
|
||||
|
||||
var containers = this.filter.map(x=>this.resolveId(id)).reduce((a,b)=>a.concat(b), [])
|
||||
var containers = filter.map(x=>this.resolveId(x)).reduce((a,b)=>a.concat(b), [])
|
||||
|
||||
if (!containers.length) return
|
||||
filter = (widget)=>{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue