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
138
Merge Requests
138
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
24aa9dd7
Commit
24aa9dd7
authored
Dec 26, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
erp5_json_editor: Disable ajax and catch promise
See merge request
nexedi/erp5!1858
parents
ebf18760
a697da76
Pipeline
#31945
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
bt5/erp5_json_editor/SkinTemplateItem/portal_skins/erp5_json_editor/json-editor.gadget.js.js
...em/portal_skins/erp5_json_editor/json-editor.gadget.js.js
+9
-9
No files found.
bt5/erp5_json_editor/SkinTemplateItem/portal_skins/erp5_json_editor/json-editor.gadget.js.js
View file @
24aa9dd7
...
@@ -152,12 +152,12 @@
...
@@ -152,12 +152,12 @@
JSONEditor
.
defaults
.
editors
.
string
.
prototype
.
setValueToInputField
=
function
(
value
)
{
JSONEditor
.
defaults
.
editors
.
string
.
prototype
.
setValueToInputField
=
function
(
value
)
{
this
.
input
.
value
=
value
===
undefined
?
''
:
value
;
this
.
input
.
value
=
value
===
undefined
?
''
:
value
;
/* ERP5: Once you set the value to the input, you also
/* ERP5: Once you set the value to the input, you also
updates the field value, otherwise the getValue will miss the value */
updates the field value, otherwise the getValue will miss the value */
this
.
value
=
this
.
input
.
value
;
this
.
value
=
this
.
input
.
value
;
};
};
/* Backward compatibility with the usage of textarea property
/* Backward compatibility with the usage of textarea property
if converts into json-editor proper property */
if converts into json-editor proper property */
JSONEditor
.
defaults
.
editors
.
string
.
prototype
.
preBuild
=
function
()
{
JSONEditor
.
defaults
.
editors
.
string
.
prototype
.
preBuild
=
function
()
{
if
((
this
.
schema
.
textarea
===
true
)
||
(
this
.
schema
.
textarea
===
1
))
{
if
((
this
.
schema
.
textarea
===
true
)
||
(
this
.
schema
.
textarea
===
1
))
{
...
@@ -188,7 +188,7 @@
...
@@ -188,7 +188,7 @@
}
}
// Ignore the first attempt since editor trigger change on the after the
// Ignore the first attempt since editor trigger change on the after the
// end of the rendering, so ignore the first attempt is reaquired.
// end of the rendering, so ignore the first attempt is reaquired.
// Later calls that trigger change
// Later calls that trigger change
gadget
.
state
.
ignoredChangeDuringInitialization
=
false
;
gadget
.
state
.
ignoredChangeDuringInitialization
=
false
;
}
}
...
@@ -221,7 +221,7 @@
...
@@ -221,7 +221,7 @@
.
push
(
function
(
schema
)
{
.
push
(
function
(
schema
)
{
return
new
JSONEditor
(
domsugar
(
json_editor_container
),
{
return
new
JSONEditor
(
domsugar
(
json_editor_container
),
{
schema
:
schema
,
schema
:
schema
,
ajax
:
tru
e
,
ajax
:
fals
e
,
theme
:
'
bootstrap5
'
,
theme
:
'
bootstrap5
'
,
show_errors
:
'
always
'
,
show_errors
:
'
always
'
,
//iconlib: 'fontawesome5',
//iconlib: 'fontawesome5',
...
@@ -245,11 +245,11 @@
...
@@ -245,11 +245,11 @@
gadget
.
editor
=
editor
;
gadget
.
editor
=
editor
;
gadget
.
editor
.
on
(
'
change
'
,
gadget
.
deferNotifyChangeBinded
.
bind
(
gadget
));
gadget
.
editor
.
on
(
'
change
'
,
gadget
.
deferNotifyChangeBinded
.
bind
(
gadget
));
//
return complex object is not possible throught ifram
e
//
editor relies on async load function, so we must return the promis
e
//
it seems to crash rjs somewhere. To check...
//
to finish before continue, otherwise rendering errors wont throw Errors
//
https://lab.nexedi.com/nexedi/renderjs/blob/master/renderjs.js#L2070
//
in the same stack as expected.
//return editor;
return
editor
.
promise
})
;
})
})
})
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
()
{
var
form_data
=
{};
var
form_data
=
{};
...
...
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