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

[renderjs_ui] LinesField renders "synchronously" with the application

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