inspector: prevent code editor oddities

This commit is contained in:
jean-emmanuel 2022-01-30 17:08:14 +01:00
parent 6c33a5736e
commit f42900058d

View file

@ -277,6 +277,11 @@ class UiInspectorField extends UiWidget {
}
var fullscreenBtn = this.container.appendChild(html`<div class="btn fullscreen">${raw(icon('expand'))}</div>`)
fullscreenBtn.addEventListener('fast-click', (e)=>{
// update dom reference because we might break them with morph in ui-inspector.js
this.container = e.target.closest('osc-inspector-field')
this.label = DOM.get(this.container, 'label')[0]
editor.fullscreen = this.container.classList.toggle('fullscreen')
editor.setOptions({maxLines: editor.fullscreen ? 0 : 30})
window.dispatchEvent(new Event('resize'))