Commit 2d643504 authored by Romain Courteaud's avatar Romain Courteaud Committed by Tristan Cavelier

[erp5_web_renderjs_ui] For refresh if render is called from parent gadget.

In reality, it should be done by internally only using changeState, but that's another story
parent ad2c408c
......@@ -178,7 +178,8 @@ and handling data send&receive.
erp5_document: undefined,
erp5_form: undefined,
url: undefined,
embedded: asBoolean(options.embedded)
embedded: asBoolean(options.embedded),
is_refresh: options.is_refresh || false
};
// options.editable differs when it comes from the erp5_launcher of FormBox - try to unify it here
......@@ -277,7 +278,7 @@ and handling data send&receive.
erp5_document = JSON.parse(gadget.state.erp5_document),
erp5_form = JSON.parse(gadget.state.erp5_form);
if (modification_dict.hasOwnProperty('url')) {
if ((!gadget.state.is_refresh) || modification_dict.hasOwnProperty('url')) {
queue = gadget.declareGadget(gadget.state.url, {scope: "fg"});
} else {
queue = gadget.getDeclaredGadget("fg");
......@@ -300,7 +301,7 @@ and handling data send&receive.
return page_template_gadget.render(sub_options);
})
.push(function () {
if (modification_dict.hasOwnProperty('url')) {
if ((!gadget.state.is_refresh) || modification_dict.hasOwnProperty('url')) {
return page_template_gadget.getElement()
.push(function (fragment) {
var element = gadget.element;
......@@ -409,6 +410,7 @@ and handling data send&receive.
// We modify inplace state.options because render method uses and removes
// erp5_document hidden in its options.
options.erp5_document = erp5_document;
options.is_refresh = true;
return new RSVP.Queue()
.push(function () {
if (response_view._notification === undefined) {
......
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>975.56533.48127.29525</string> </value>
<value> <string>976.24235.55108.50397</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1558448080.86</float>
<float>1560442327.31</float>
<string>UTC</string>
</tuple>
</state>
......
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