Commit 1f057981 authored by Tomáš Peterka's avatar Tomáš Peterka Committed by Tomáš Peterka

[renderjs_ui] Explicitely state ID value for HTML elements

parent 471aecda
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
state_dict = { state_dict = {
checked: asBool(field_json.value || field_json.default), checked: asBool(field_json.value || field_json.default),
editable: field_json.editable, editable: field_json.editable,
id: field_json.key,
name: field_json.key, name: field_json.key,
title: field_json.title, title: field_json.title,
hidden: field_json.hidden, hidden: field_json.hidden,
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.10615.49166.8413</string> </value> <value> <string>965.12118.35525.1655</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>1517321807.6</float> <float>1517929521.54</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
value: field_json.value || field_json.default || "", value: field_json.value || field_json.default || "",
editable: field_json.editable, editable: field_json.editable,
required: field_json.required, required: field_json.required,
id: field_json.key,
name: field_json.key, name: field_json.key,
key: field_json.key, key: field_json.key,
title: field_json.title, title: field_json.title,
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.3167.36247.3959</string> </value> <value> <string>965.12118.35525.1655</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1517321711.65</float> <float>1517930509.55</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
editable: field_json.editable, editable: field_json.editable,
required: field_json.required, required: field_json.required,
hidden: field_json.hidden, hidden: field_json.hidden,
id: field_json.key,
name: field_json.key, name: field_json.key,
title: field_json.title, title: field_json.title,
precision: window.parseFloat(field_json.precision), precision: window.parseFloat(field_json.precision),
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.241.13759.3805</string> </value> <value> <string>965.12118.35525.1655</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>1517321634.14</float> <float>1517930362.54</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
value: field_json.value || field_json.default || "", value: field_json.value || field_json.default || "",
editable: field_json.editable, editable: field_json.editable,
required: field_json.required, required: field_json.required,
id: field_json.key,
name: field_json.key, name: field_json.key,
title: field_json.title, title: field_json.title,
hidden: field_json.hidden, hidden: field_json.hidden,
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.241.13759.3805</string> </value> <value> <string>965.12118.35525.1655</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>1517321585.88</float> <float>1517930232.43</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
value: field_json.value || field_json.default || "", value: field_json.value || field_json.default || "",
editable: field_json.editable, editable: field_json.editable,
required: field_json.required, required: field_json.required,
id: field_json.key,
name: field_json.key, name: field_json.key,
title: field_json.title, title: field_json.title,
type: 'password', type: 'password',
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.241.13759.3805</string> </value> <value> <string>965.12118.35525.1655</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>1517321403.8</float> <float>1517929207.17</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
var field_json = options.field_json || {}, var field_json = options.field_json || {},
state_dict = { state_dict = {
text_content: field_json.value || field_json.default || "", text_content: field_json.value || field_json.default || "",
id: field_json.key,
hidden: field_json.hidden hidden: field_json.hidden
}; };
return this.changeState(state_dict); return this.changeState(state_dict);
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>954.45675.44850.53452</string> </value> <value> <string>965.20749.13387.4693</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>1479375342.52</float> <float>1517935672.03</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
value: field_json.value || field_json.default || "", value: field_json.value || field_json.default || "",
editable: field_json.editable, editable: field_json.editable,
required: field_json.required, required: field_json.required,
id: field_json.key,
name: field_json.key, name: field_json.key,
title: field_json.title, title: field_json.title,
hidden: field_json.hidden, hidden: field_json.hidden,
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.64440.33953.5239</string> </value> <value> <string>965.12118.35525.1655</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>1516627821.55</float> <float>1517929158.68</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
value: field_json.value || field_json.default || "", value: field_json.value || field_json.default || "",
editable: field_json.editable, editable: field_json.editable,
name: field_json.key, name: field_json.key,
id: field_json.key,
title: field_json.title, title: field_json.title,
hidden: field_json.hidden, hidden: field_json.hidden,
// Force calling subfield render // Force calling subfield render
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.241.13759.3805</string> </value> <value> <string>965.12118.35525.1655</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1517321833.44</float> <float>1517927278.74</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
tag: 'div', tag: 'div',
text_content: '', text_content: '',
inner_html: '', inner_html: '',
id: undefined,
name: undefined, name: undefined,
src: undefined, src: undefined,
alt: undefined, alt: undefined,
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
var state_dict = { var state_dict = {
text_content: options.text_content || "", text_content: options.text_content || "",
inner_html: options.inner_html || "", inner_html: options.inner_html || "",
id: options.id,
tag: options.tag || 'div', tag: options.tag || 'div',
src: options.src, src: options.src,
alt: options.alt, alt: options.alt,
...@@ -52,6 +54,9 @@ ...@@ -52,6 +54,9 @@
} else if (this.state.inner_html) { } else if (this.state.inner_html) {
new_element.innerHTML = this.state.inner_html; new_element.innerHTML = this.state.inner_html;
} }
if (this.state.id) {
new_element.id = this.state.id;
}
if (this.state.src) { if (this.state.src) {
new_element.setAttribute('src', this.state.src); new_element.setAttribute('src', this.state.src);
} }
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.27113.53962.34457</string> </value> <value> <string>965.20431.18358.64853</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1514379841.99</float> <float>1517925786.08</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
checked: options.checked, checked: options.checked,
editable: options.editable, editable: options.editable,
required: options.required, required: options.required,
id: options.id,
name: options.name, name: options.name,
type: options.type || 'text', type: options.type || 'text',
title: options.title, title: options.title,
...@@ -48,8 +49,8 @@ ...@@ -48,8 +49,8 @@
if (this.state.type === 'radio') { if (this.state.type === 'radio') {
textarea.checked = this.state.checked; textarea.checked = this.state.checked;
} }
textarea.id = this.state.id || this.state.name;
textarea.setAttribute('name', this.state.name); textarea.setAttribute('name', this.state.name);
textarea.setAttribute('id', this.state.name);
textarea.setAttribute('type', this.state.type); textarea.setAttribute('type', this.state.type);
if (this.state.title) { if (this.state.title) {
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
item_list: JSON.stringify(options.item_list), item_list: JSON.stringify(options.item_list),
editable: options.editable, editable: options.editable,
required: options.required, required: options.required,
id: options.id,
name: options.name, name: options.name,
title: options.title, title: options.title,
hidden: options.hidden hidden: options.hidden
...@@ -51,8 +52,8 @@ ...@@ -51,8 +52,8 @@
item_list = JSON.parse(this.state.item_list), item_list = JSON.parse(this.state.item_list),
tmp = ""; tmp = "";
select.id = this.state.id || this.state.name;
select.setAttribute('name', this.state.name); select.setAttribute('name', this.state.name);
select.setAttribute('id', this.state.name);
if (this.state.title) { if (this.state.title) {
select.setAttribute('title', this.state.title); select.setAttribute('title', this.state.title);
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.10979.12054.27869</string> </value> <value> <string>965.20731.29683.40857</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>1517406671.4</float> <float>1517936194.62</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