mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 23:53:49 +00:00
[Code Style] Use prototypes in Scrolling List bundle
WTD-1482.
This commit is contained in:
@ -34,6 +34,7 @@ define(
|
||||
* (typically, timestamps.) Used by the ScrollingListController.
|
||||
*
|
||||
* @memberof platform/features/scrolling
|
||||
* @implements {platform/features/scrolling.ScrollingColumn}
|
||||
* @constructor
|
||||
* @param domainMetadata an object with the machine- and human-
|
||||
* readable names for this domain (in `key` and `name`
|
||||
@ -42,31 +43,22 @@ define(
|
||||
* formatting service, for making values human-readable.
|
||||
*/
|
||||
function DomainColumn(domainMetadata, telemetryFormatter) {
|
||||
return {
|
||||
/**
|
||||
* Get the title to display in this column's header.
|
||||
* @returns {string} the title to display
|
||||
* @memberof platform/features/scrolling.DomainColumn#
|
||||
*/
|
||||
getTitle: function () {
|
||||
return domainMetadata.name;
|
||||
},
|
||||
/**
|
||||
* Get the text to display inside a row under this
|
||||
* column.
|
||||
* @returns {string} the text to display
|
||||
* @memberof platform/features/scrolling.DomainColumn#
|
||||
*/
|
||||
getValue: function (domainObject, datum) {
|
||||
return {
|
||||
text: telemetryFormatter.formatDomainValue(
|
||||
datum[domainMetadata.key]
|
||||
)
|
||||
};
|
||||
}
|
||||
};
|
||||
this.domainMetadata = domainMetadata;
|
||||
this.telemetryFormatter = telemetryFormatter;
|
||||
}
|
||||
|
||||
DomainColumn.prototype.getTitle = function () {
|
||||
return this.domainMetadata.name;
|
||||
};
|
||||
|
||||
DomainColumn.prototype.getValue = function (domainObject, datum) {
|
||||
return {
|
||||
text: this.telemetryFormatter.formatDomainValue(
|
||||
datum[this.domainMetadata.key]
|
||||
)
|
||||
};
|
||||
};
|
||||
|
||||
return DomainColumn;
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user