Commit 24aa9dd7 authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_json_editor: Disable ajax and catch promise

See merge request nexedi/erp5!1858
parents ebf18760 a697da76
...@@ -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: true, ajax: false,
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 iframe // editor relies on async load function, so we must return the promise
// 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 = {};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment