Commit b1e0ebc2 authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Cédric Le Ninivin

erp5_production_planning: fix copy issue from windows

parent dea39158
...@@ -132,7 +132,16 @@ function listenToInputPaste(matrixbox_container) { ...@@ -132,7 +132,16 @@ function listenToInputPaste(matrixbox_container) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
pasted_value = pasted_value.split('\n'); pasted_value = pasted_value.split('\n');
//libre office add "" at last line
if (pasted_value[pasted_value.length - 1] == '') {
pasted_value = pasted_value.slice(0, -1);
}
for (i = 0; i < pasted_value.length; i += 1) { for (i = 0; i < pasted_value.length; i += 1) {
length = pasted_value[i].length;
//in windows, '\r' is added in the end of each line, remove it
if (pasted_value[i][pasted_value[i].length -1] == '\r') {
pasted_value[i] = pasted_value[i].slice(0, -1);
}
value_list = pasted_value[i].split(/\s+/); value_list = pasted_value[i].split(/\s+/);
tr = matrixbox.find('tr:eq(' + (tr_index + i) + ')'); tr = matrixbox.find('tr:eq(' + (tr_index + i) + ')');
for (j = 0; j < value_list.length; j += 1) { for (j = 0; j < value_list.length; j += 1) {
......
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