mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 07:10:06 +02:00
handle removal of last row and removal of hidden input for empty array
This commit is contained in:
parent
e1b64275c9
commit
98925e4adb
1 changed files with 6 additions and 0 deletions
|
@ -425,6 +425,9 @@ function addTableRow(add_glyphicon) {
|
||||||
|
|
||||||
if (isArray) {
|
if (isArray) {
|
||||||
updateDataChangedForSiblingRows(row, true)
|
updateDataChangedForSiblingRows(row, true)
|
||||||
|
|
||||||
|
// the addition of any table row should remove the empty-array-row
|
||||||
|
row.siblings('.empty-array-row').remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
badgeSidebarForDifferences($(table))
|
badgeSidebarForDifferences($(table))
|
||||||
|
@ -451,6 +454,9 @@ function deleteTableRow(delete_glyphicon) {
|
||||||
// this is the last row, we can't remove it completely since we need to post an empty array
|
// this is the last row, we can't remove it completely since we need to post an empty array
|
||||||
row.empty()
|
row.empty()
|
||||||
|
|
||||||
|
row.removeClass('new-row row-data')
|
||||||
|
row.addClass('empty-array-row')
|
||||||
|
|
||||||
row.html("<input type='hidden' class='form-control' name='" + table.attr("name").replace('[]', '')
|
row.html("<input type='hidden' class='form-control' name='" + table.attr("name").replace('[]', '')
|
||||||
+ "' data-changed='true' value=''>");
|
+ "' data-changed='true' value=''>");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue