Commit 5db0d4ff authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Allow to focus on input by clicking on label

Set ID attribute on input fields.
https://www.w3.org/TR/html5/forms.html#the-label-element
parent 8dcb5112
......@@ -82,7 +82,7 @@
queue = new RSVP.Queue(),
promise_list,
input_state = {
name: gadget.state.key + '_input',
name: gadget.state.key,
editable: gadget.state.editable,
required: gadget.state.required,
type: gadget.state.date_only ? "date" : "datetime-local",
......@@ -262,7 +262,7 @@
return RSVP.all(promise_list);
})
.push(function (result_list) {
var value = result_list[0][gadget.state.key + '_input'],
var value = result_list[0][gadget.state.key],
timezone = "+0000",
year,
month,
......
......@@ -224,7 +224,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.15728.7577.42257</string> </value>
<value> <string>956.58742.58866.48708</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -242,7 +242,7 @@
</tuple>
<state>
<tuple>
<float>1482843916.5</float>
<float>1490624147.2</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -20,7 +20,7 @@
<script id="relation-input-template" type="text/x-handlebars-template">
<div class="relation-input ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset ui-input-has-clear ui-input-has-icon">
<div>
<input type='search' title="{{title}}" name="{{name}}" autocomplete="off" data-enhanced="true" value="{{value}}" >
<input type='search' title="{{title}}" name="{{name}}" id="{{name}}" autocomplete="off" data-enhanced="true" value="{{value}}" >
<ul class="ui-listview ui-corner-all search_ul"></ul>
</div>
<a href={{href}} tabindex="-1" class="{{class_name}}" >Jump to this document</a>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.5712.44925.37444</string> </value>
<value> <string>956.58742.58866.48708</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1474553624.23</float>
<float>1490623129.84</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -43,6 +43,8 @@
textarea.checked = this.state.checked;
}
textarea.setAttribute('name', this.state.name);
textarea.setAttribute('id', this.state.name);
textarea.setAttribute('type', this.state.type);
if (this.state.title) {
textarea.setAttribute('title', this.state.title);
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.60922.14888.40516</string> </value>
<value> <string>956.58742.58866.48708</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482843242.96</float>
<float>1490622626.22</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -52,6 +52,8 @@
tmp = "";
select.setAttribute('name', this.state.name);
select.setAttribute('id', this.state.name);
if (this.state.title) {
select.setAttribute('title', this.state.title);
}
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.51162.4768.35123</string> </value>
<value> <string>956.58742.58866.48708</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482843283.34</float>
<float>1490622780.06</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -36,6 +36,8 @@
// textarea.setAttribute('value', this.state.value);
textarea.value = this.state.value;
textarea.setAttribute('name', this.state.name);
textarea.setAttribute('id', this.state.name);
textarea.setAttribute('title', this.state.title);
if (this.state.required) {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.18003.19903.19131</string> </value>
<value> <string>956.58742.58866.48708</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1479374797.29</float>
<float>1490622800.75</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