Commit db52797a authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] LabelField should not write in subgadget span

Regression introduced by cf1a0610
parent ae2c27cd
...@@ -124,15 +124,21 @@ ...@@ -124,15 +124,21 @@
if (modification_dict.hasOwnProperty('error_text')) { if (modification_dict.hasOwnProperty('error_text')) {
// first remove old errors // first remove old errors
span = this.state.container_element.querySelector('span'); span = this.state.container_element.lastElementChild;
if (span) { if ((span !== null) && (span.tagName.toLowerCase() !== 'span')) {
this.state.container_element.removeChild(span); span = null;
} }
// display new error if present // display new error if present
if (this.state.error_text) { if (this.state.error_text) {
if (span === null) {
span = document.createElement('span'); span = document.createElement('span');
span.textContent = this.state.error_text; span.textContent = this.state.error_text;
this.state.container_element.appendChild(span); this.state.container_element.appendChild(span);
} else {
span.textContent = this.state.error_text;
}
} else if (span !== null) {
this.state.container_element.removeChild(span);
} }
} }
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.46539.43459.6519</string> </value> <value> <string>964.7149.35202.27306</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>1503932157.58</float> <float>1513181723.22</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