Compare commits
2 Commits
1595ea9017
...
f8af750f02
Author | SHA1 | Date |
---|---|---|
King Kévin | f8af750f02 | |
King Kévin | 682e0cd9aa |
|
@ -100,7 +100,7 @@ function select_part()
|
|||
const span = document.getElementById('url_' + field);
|
||||
const text = span.innerText;
|
||||
span.innerHTML = null;
|
||||
if (undefined === part[field] || null == part[field]) {
|
||||
if (undefined === part[field] || null == part[field] || 0 == part[field].length) {
|
||||
span.innerHTML = text;
|
||||
} else {
|
||||
const a = document.createElement('a');
|
||||
|
@ -113,12 +113,13 @@ function select_part()
|
|||
for (const table of tables) {
|
||||
const tbody = document.getElementById(table);
|
||||
tbody.innerHTML = null;
|
||||
const content = part[table].slice();
|
||||
if ("components" == table) {
|
||||
part[table].push({name: "", quantity: ""}); // empty field to add
|
||||
content.push({name: "", quantity: ""}); // empty field to add
|
||||
} else {
|
||||
part[table].push({name: "", value: ""}); // empty field to add
|
||||
content.push({name: "", value: ""}); // empty field to add
|
||||
}
|
||||
for (const row of part[table]) {
|
||||
for (const row of content) {
|
||||
const tr = document.createElement('tr');
|
||||
let td = document.createElement('td');
|
||||
let input = document.createElement('input');
|
||||
|
|
Loading…
Reference in New Issue