mirror of
https://github.com/nasa/openmct.git
synced 2025-04-23 10:23:43 +00:00
Modified code to call resize on every row add. Removed optimization to only resize when needed, because in fact resuze is necessary on every update in order to set vertical scroll size
This commit is contained in:
parent
2fb9b65652
commit
f34e8ba61b
@ -80,14 +80,6 @@ define(
|
||||
$scope.$on('remove:row', this.removeRow.bind(this));
|
||||
}
|
||||
|
||||
function fastPromise(returnValue) {
|
||||
return {
|
||||
then: function (callback) {
|
||||
return fastPromise(callback(returnValue));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* If auto-scroll is enabled, this function will scroll to the
|
||||
* bottom of the page
|
||||
@ -118,8 +110,7 @@ define(
|
||||
//Insert the row into the correct position in the array
|
||||
this.insertSorted(this.$scope.displayRows, row);
|
||||
|
||||
//Resize the columns , then update the rows
|
||||
// visible in the table
|
||||
//Resize the columns , then update the rows visible in the table
|
||||
this.resize([this.$scope.sizingRow, row])
|
||||
.then(this.setVisibleRows.bind(this))
|
||||
.then(this.scrollToBottom.bind(this));
|
||||
@ -460,17 +451,9 @@ define(
|
||||
* @private
|
||||
*/
|
||||
MCTTableController.prototype.resize = function (rows){
|
||||
//Calculate largest row
|
||||
var largestRow = this.buildLargestRow(rows);
|
||||
|
||||
// Has it changed? If so, set the the 'sizing' row which
|
||||
// determines column widths
|
||||
if (JSON.stringify(largestRow) !== JSON.stringify(this.$scope.sizingRow)){
|
||||
this.$scope.sizingRow = largestRow;
|
||||
return this.$timeout(this.setElementSizes.bind(this));
|
||||
} else {
|
||||
return fastPromise(undefined);
|
||||
}
|
||||
this.$scope.sizingRow = this.buildLargestRow(rows);
|
||||
return this.$timeout(this.setElementSizes.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user