Commit 9c1b5e61 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] LabelField: rerender field only if options has been modified

parent 60e7ca3a
...@@ -64,26 +64,28 @@ ...@@ -64,26 +64,28 @@
} }
} }
if (this.state.field_url) { if (modification_dict.hasOwnProperty('options')) {
return new RSVP.Queue() if (this.state.field_url) {
.push(function () { return new RSVP.Queue()
if (modification_dict.hasOwnProperty('field_url')) { .push(function () {
return gadget.declareGadget(gadget.state.field_url, { if (modification_dict.hasOwnProperty('field_url')) {
scope: SCOPE return gadget.declareGadget(gadget.state.field_url, {
}) scope: SCOPE
.push(function (field_gadget) { })
gadget.state.container_element.removeChild( .push(function (field_gadget) {
gadget.state.container_element.querySelector('div') gadget.state.container_element.removeChild(
); gadget.state.container_element.querySelector('div')
gadget.state.container_element.appendChild(field_gadget.element); );
return field_gadget; gadget.state.container_element.appendChild(field_gadget.element);
}); return field_gadget;
} });
return gadget.getDeclaredGadget(SCOPE); }
}) return gadget.getDeclaredGadget(SCOPE);
.push(function (field_gadget) { })
return field_gadget.render(gadget.state.options); .push(function (field_gadget) {
}); return field_gadget.render(gadget.state.options);
});
}
} }
}) })
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>955.22025.27821.47377</string> </value> <value> <string>955.29626.47611.24814</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1479376095.96</float> <float>1479998167.15</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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