Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
139
Merge Requests
139
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
867b5b67
Commit
867b5b67
authored
Oct 29, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monaco_editor: setValue once everything is initialized
parent
c7d5e1b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
bt5/erp5_monaco_editor/SkinTemplateItem/portal_skins/erp5_monaco_editor/monaco-editor.gadget.js.js
...ortal_skins/erp5_monaco_editor/monaco-editor.gadget.js.js
+11
-7
No files found.
bt5/erp5_monaco_editor/SkinTemplateItem/portal_skins/erp5_monaco_editor/monaco-editor.gadget.js.js
View file @
867b5b67
...
...
@@ -124,12 +124,8 @@
.
onStateChange
(
function
(
modification_dict
)
{
var
queue
=
new
RSVP
.
Queue
();
if
(
modification_dict
.
hasOwnProperty
(
'
value
'
))
{
// Do not notify the UI when initializing the value
this
.
state
.
ignoredChangeDuringInitialization
=
true
;
this
.
editor
.
setValue
(
this
.
state
.
value
);
this
.
state
.
ignoredChangeDuringInitialization
=
false
;
}
// make the editor readonly until fully initialized
this
.
editor
.
updateOptions
({
readOnly
:
true
});
if
(
modification_dict
.
hasOwnProperty
(
'
model_language
'
))
{
monaco
.
editor
.
setModelLanguage
(
this
.
editor
.
getModel
(),
...
...
@@ -327,10 +323,18 @@
enableSchemaRequest
:
true
,
});
}
}
queue
.
push
(()
=>
{
if
(
modification_dict
.
hasOwnProperty
(
'
value
'
))
{
// Do not notify the UI when initializing the value
this
.
state
.
ignoredChangeDuringInitialization
=
true
;
this
.
editor
.
setValue
(
this
.
state
.
value
);
this
.
state
.
ignoredChangeDuringInitialization
=
false
;
}
if
(
modification_dict
.
hasOwnProperty
(
'
editable
'
))
{
this
.
editor
.
updateOptions
({
readOnly
:
!
this
.
state
.
editable
});
}
}
}
)
return
queue
;
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment