Commit 660050d4 by Romain Courteaud

[erp5_web_renderjs_ui] Allow to submit the form action from textarea

parent 13c77d52
......@@ -19,22 +19,32 @@
return this.changeState(state_dict);
})
.declareMethod('updateDOM', function () {
.declareMethod('updateDOM', function (modification_dict) {
var element = this.element,
gadget = this,
url;
if (gadget.state.editable) {
url = 'gadget_html5_textarea.html';
url,
result;
if (modification_dict.hasOwnProperty('editable')) {
if (gadget.state.editable) {
url = 'gadget_html5_textarea.html';
} else {
url = 'gadget_html5_element.html';
}
result = this.declareGadget(url, {scope: 'sub'})
.push(function (input) {
// Clear first to DOM, append after to reduce flickering/manip
while (element.firstChild) {
element.removeChild(element.firstChild);
}
element.appendChild(input.element);
return input;
});
} else {
url = 'gadget_html5_element.html';
result = this.getDeclaredGadget('sub');
}
return this.declareGadget(url, {scope: 'sub'})
return result
.push(function (input) {
// Clear first to DOM, append after to reduce flickering/manip
while (element.firstChild) {
element.removeChild(element.firstChild);
}
element.appendChild(input.element);
return input.render(gadget.state);
});
})
......
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1475163059.77</float>
<float>1475764759.74</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -33,6 +33,7 @@
.declareMethod('updateDOM', function () {
var textarea = this.element.querySelector('textarea');
// textarea.setAttribute('value', this.state.value);
textarea.value = this.state.value;
textarea.setAttribute('name', this.state.name);
textarea.setAttribute('title', this.state.title);
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.22955.35469.52377</string> </value>
<value> <string>954.27370.32393.51592</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1475499846.91</float>
<float>1475769541.61</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 sign in to comment