From 3da569700a3470eb4c7fa10e134aee797277c521 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 22 Jan 2026 12:04:50 +0100 Subject: [PATCH] code editor: add content changed hint --- CHANGELOG.md | 3 ++- src/client/ui/ui-code-editor.mjs | 5 +++++ src/scss/ui/inspector.scss | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13c64005..3015a9c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/client/ui/ui-code-editor.mjs b/src/client/ui/ui-code-editor.mjs index 62105432..8998f752 100644 --- a/src/client/ui/ui-code-editor.mjs +++ b/src/client/ui/ui-code-editor.mjs @@ -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 diff --git a/src/scss/ui/inspector.scss b/src/scss/ui/inspector.scss index 1af9e113..e668e72d 100644 --- a/src/scss/ui/inspector.scss +++ b/src/scss/ui/inspector.scss @@ -190,6 +190,9 @@ osc-inspector-field { > label:before { content: var(--prefix); } + &.dirty label:after{ + content: "*" + } .btn { margin-top: 50rem; margin-right: 50rem;