[Code Style] Use prototypes in Scrolling List bundle

WTD-1482.
This commit is contained in:
Victor Woeltjen
2015-08-13 12:35:48 -07:00
parent 820c15d74c
commit 6302eee17e
5 changed files with 189 additions and 191 deletions

View File

@ -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;
}
);