diff --git a/CHANGELOG.md b/CHANGELOG.md index c95ae6bb..b7b08f3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - editor - when focusing the label property with `F2`, select all text in the text area - preserve scroll position in code editor when validating - + - display the id of selected widget in the inspector's header - scripting - expose file browser (from the file widget) as a scripting function diff --git a/src/client/ui/ui-inspector.js b/src/client/ui/ui-inspector.js index e801f8b1..f43aba4a 100644 --- a/src/client/ui/ui-inspector.js +++ b/src/client/ui/ui-inspector.js @@ -31,7 +31,7 @@ class UiInspector extends UiWidget {
- + @@ -39,8 +39,10 @@ class UiInspector extends UiWidget { this.toolbarBtns = {} DOM.each(this.toolbar, '.btn', (item)=>{ var action = item.getAttribute('data-action') - item.setAttribute('title', locales('inspector_' + action.replace('-', '_'))) - this.toolbarBtns[action] = item + if (action) { + if (action !== 'selected-id') item.setAttribute('title', locales('inspector_' + action.replace('-', '_'))) + this.toolbarBtns[action] = item + } }) zoom.on('local-zoom-changed',()=>{ this.toolbarBtns['zoom-out'].classList.toggle('active', zoom.localZoom < 1) @@ -163,6 +165,7 @@ class UiInspector extends UiWidget { this.clearTimeout = setTimeout(()=>{ this.widget = null this.content.innerHTML = '' + this.toolbarBtns['selected-id'].firstChild.innerHTML = '' this.mounted = false this.clearTimeout = null this.colorPicker.close() @@ -259,6 +262,8 @@ class UiInspector extends UiWidget { morph(this.content, content) + this.toolbarBtns['selected-id'].firstChild.innerHTML = widgets.map(x=>x.getProp('id')).join(', ') + if (codeEditorFields.length) { let fields = DOM.get(this.container, '.has-editor') for (var i in codeEditorFields) { diff --git a/src/scss/ui/inspector.scss b/src/scss/ui/inspector.scss index 323e1586..5c660d49 100644 --- a/src/scss/ui/inspector.scss +++ b/src/scss/ui/inspector.scss @@ -46,6 +46,10 @@ osc-panel-container.right.editor-breakout { align-items: center; justify-content: center; display: flex; + span{ + overflow: hidden; + text-overflow: ellipsis; + } i { pointer-events: none; } @@ -64,8 +68,9 @@ osc-panel-container.right.editor-breakout { transform: rotate(45deg); } } - .spacer { - flex: 1 + [data-action="selected-id"] { + flex: 1; + cursor: default; } }