mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
Fix Row marking (#2458)
Fix row marking issue discovered during r4.2 testing
This commit is contained in:
parent
a0864a8702
commit
4f3a3befe0
@ -733,9 +733,21 @@ export default {
|
||||
this.markedRows.forEach(r => r.marked = false);
|
||||
this.markedRows = [];
|
||||
},
|
||||
unmarkRow(rowIndex) {
|
||||
this.undoMarkedRows();
|
||||
this.unpause();
|
||||
unmarkRow(rowIndex, ctrlKeyModifier) {
|
||||
if (ctrlKeyModifier) {
|
||||
let row = this.visibleRows[rowIndex],
|
||||
positionInMarkedArray = this.markedRows.indexOf(row);
|
||||
|
||||
row.marked = false;
|
||||
this.markedRows.splice(positionInMarkedArray, 1);
|
||||
|
||||
if (this.markedRows.length === 0) {
|
||||
this.unpause();
|
||||
}
|
||||
} else if (this.markedRows.length) {
|
||||
this.undoMarkedRows();
|
||||
this.markRow(rowIndex);
|
||||
}
|
||||
},
|
||||
markRow(rowIndex, keyModifier) {
|
||||
if (!this.enableMarking) {
|
||||
@ -785,16 +797,18 @@ export default {
|
||||
|
||||
//supports backward selection
|
||||
if (lastRowIndex < firstRowIndex) {
|
||||
let temp = lastRowIndex;
|
||||
|
||||
lastRowIndex = firstRowIndex;
|
||||
firstRowIndex = temp - 1;
|
||||
[firstRowIndex, lastRowIndex] = [lastRowIndex, firstRowIndex];
|
||||
}
|
||||
|
||||
let baseRow = this.markedRows[0];
|
||||
|
||||
for (var i = firstRowIndex + 1; i <= lastRowIndex; i++) {
|
||||
for (var i = firstRowIndex; i <= lastRowIndex; i++) {
|
||||
let row = allRows[i];
|
||||
row.marked = true;
|
||||
this.markedRows.push(row);
|
||||
|
||||
if (row !== baseRow){
|
||||
this.markedRows.push(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user