mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 08:39:59 +00:00
[Tables] #801 Documented MctTable directive
This commit is contained in:
@ -85,7 +85,7 @@ define(
|
||||
then: function (callback) {
|
||||
return fastPromise(callback(returnValue));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -68,6 +68,10 @@ define(
|
||||
|
||||
RealtimeTableController.prototype = Object.create(TableController.prototype);
|
||||
|
||||
/**
|
||||
* Overrides method on TelemetryTableController providing handling
|
||||
* for realtime data.
|
||||
*/
|
||||
RealtimeTableController.prototype.addRealtimeData = function() {
|
||||
var self = this,
|
||||
datum,
|
||||
@ -89,7 +93,7 @@ define(
|
||||
self.$scope.rows.length - 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return RealtimeTableController;
|
||||
}
|
||||
|
@ -55,8 +55,15 @@ define(
|
||||
|
||||
$scope.columnsForm = {};
|
||||
|
||||
function unlisten() {
|
||||
self.listeners.forEach(function (listener) {
|
||||
listener();
|
||||
});
|
||||
}
|
||||
|
||||
$scope.$watch('domainObject', function(domainObject) {
|
||||
self.populateForm(domainObject.getModel());
|
||||
unlisten();
|
||||
self.populateForm(domainObject.getModel());
|
||||
|
||||
self.listeners.push(self.domainObject.getCapability('mutation').listen(function (model) {
|
||||
self.populateForm(model);
|
||||
@ -79,11 +86,7 @@ define(
|
||||
/**
|
||||
* Destroy all mutation listeners
|
||||
*/
|
||||
$scope.$on('$destroy', function () {
|
||||
self.listeners.forEach(function (listener) {
|
||||
listener();
|
||||
});
|
||||
})
|
||||
$scope.$on('$destroy', unlisten);
|
||||
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ define(
|
||||
return listener && listener();
|
||||
});
|
||||
this.changeListeners = [];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Defer registration of change listeners until domain object is
|
||||
@ -156,7 +156,7 @@ define(
|
||||
|
||||
if (handle) {
|
||||
handle.promiseTelemetryObjects().then(function () {
|
||||
self.$scope.headers = []
|
||||
self.$scope.headers = [];
|
||||
self.$scope.rows = [];
|
||||
table.populateColumns(handle.getMetadata());
|
||||
|
||||
|
Reference in New Issue
Block a user