code editor: add content changed hint

This commit is contained in:
jean-emmanuel 2026-01-22 12:04:50 +01:00
parent daa4fbfecf
commit 3da569700a
3 changed files with 10 additions and 1 deletions

View file

@ -6,7 +6,8 @@
- when using objects in properties, numbers-as-strings and booleans-as-strings values are now preserved instead of being converted to their litteral counterparts
- editor
- preserve code editor undo history between consecutive edits of a same widget's property
- preserve code editor undo history between consecutive edits of a same widget's property
- preserve fullscreen code editor focus when saving / submitting
## 1.30.1

View file

@ -141,6 +141,8 @@ class CodeEditor {
editor.textarea.osc_input = input
editor.textarea.tabIndex = 0
this.field.classList.remove('dirty')
editor.removeAllListeners('focus')
this.editor.on('focus', (e)=>{
this.parent.focusedInput = this.input
@ -153,6 +155,9 @@ class CodeEditor {
this.editor.on('change', (e)=>{
this.input.value = this.editor.getValue()
this.editor.dirty = true
if (this.editor.fullscreen) {
this.field.classList.add('dirty')
}
})
this.typing = false

View file

@ -190,6 +190,9 @@ osc-inspector-field {
> label:before {
content: var(--prefix);
}
&.dirty label:after{
content: "*"
}
.btn {
margin-top: 50rem;
margin-right: 50rem;