[Scrolling] Add JSDoc, clean up

Clean up scripts for Scrolling List view and add
some JSDoc. WTD-534.
This commit is contained in:
Victor Woeltjen
2014-12-02 15:21:26 -08:00
parent d304cc4343
commit e711073cb5
4 changed files with 74 additions and 13 deletions

View File

@ -9,19 +9,31 @@ define(
"use strict";
/**
* A column which will report telemetry range values
* (typically, measurements.) Used by the ScrollingListController.
*
* @constructor
* @param rangeMetadata an object with the machine- and human-
* readable names for this range (in `key` and `name`
* fields, respectively.)
*/
function RangeColumn(rangeMetadata) {
return {
/**
* Get the title to display in this column's header.
* @returns {string} the title to display
*/
getTitle: function () {
return rangeMetadata.name;
},
/**
* Get the text to display inside a row under this
* column.
* @returns {string} the text to display
*/
getValue: function (domainObject, data, index) {
return data.getRangeValue(
index,
rangeMetadata.key
);
var value = data.getRangeValue(index, rangeMetadata.key);
return value && value.toFixed(3);
}
};
}