mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
Merge pull request #10716 from birarda/feat/replicants
fix for table additions when there is no initial row
This commit is contained in:
commit
062713de8a
1 changed files with 8 additions and 2 deletions
|
@ -1404,8 +1404,14 @@ function addTableRow(row) {
|
|||
// as a data attribute to the row
|
||||
var row_index = 0;
|
||||
if (isArray) {
|
||||
var previous_row_index = parseInt(row.siblings('.' + Settings.DATA_ROW_CLASS + ':last').attr(Settings.DATA_ROW_INDEX), 10);
|
||||
row_index = previous_row_index + 1;
|
||||
var previous_row = row.siblings('.' + Settings.DATA_ROW_CLASS + ':last');
|
||||
|
||||
if (previous_row.length > 0) {
|
||||
row_index = parseInt(previous_row.attr(Settings.DATA_ROW_INDEX), 10) + 1;
|
||||
} else {
|
||||
row_index = 0;
|
||||
}
|
||||
|
||||
row.attr(Settings.DATA_ROW_INDEX, row_index);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue