Commit 61d51dbe authored by Tomáš Peterka's avatar Tomáš Peterka Committed by Tomáš Peterka

[renderjs_ui] LinesField renders "synchronously" with the application

/reviewed-on !484
parent 56530e6e
......@@ -3,14 +3,14 @@
(function (window, rJS) {
"use strict";
function listToNewlines(list) {
if (list.constructor === Array) {return list.join("\n"); }
return list;
function listToNewlines(lines) {
if (Array.isArray(lines)) {return lines.join("\n"); }
return lines;
}
function listToBR(list) {
if (list.constructor === Array) {return list.join("<br/>\n"); }
return list;
function listToBR(lines) {
if (Array.isArray(lines)) {return lines.join("<br/>\n"); }
return lines;
}
rJS(window)
......@@ -50,7 +50,7 @@
});
});
}
return gadget.getDeclaredGadget('sub')
.push(function (input) {
if (modification_dict.hasOwnProperty("value")) {
......@@ -61,7 +61,7 @@
}
}
// when we only receive changes we can simply pass (minimaly modified) modification dictionary
input.render(modification_dict);
return input.render(modification_dict);
});
})
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.46312.16078.20206</string> </value>
<value> <string>961.56527.16709.20804</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1503932173.09</float>
<float>1510071879.23</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -22,7 +22,9 @@
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_field_lines.html"]//textarea</td><td></td></tr>
<tr><td>type</td>
<td>field_my_lines_list</td>
<td>javascript{"\na\nb\n"}</td></tr>
<td>a
b
</td></tr>
<tr><td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td><td></td></tr>
<tr><td>click</td>
......@@ -39,8 +41,10 @@
<td>//div[@data-gadget-url='${renderjs_url}/gadget_erp5_field_listbox.html']//table/tbody/tr[1]//a</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_field_lines.html"]//textarea</td><td></td></tr>
<tr><td>assertEval</td>
<td>this.browserbot.findElement('field_my_lines_list').value</td>
<td>javascript{"\na\nb\n"}</td></tr>
<tr><td>assertValue</td>
<td>//textarea[@name='field_my_lines_list']</td>
<td>a
b
</td></tr>
</body>
</html>
\ No newline at end of file
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