Commit ab7d9964 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 891c52e4
......@@ -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) {
......
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