[Style] Pull functions out of loop

Pull functions out of loop for jshint compliance.
This commit is contained in:
Pete Richards 2016-03-01 13:25:37 -08:00
parent b9e0a77655
commit 668b09b789

View File

@ -57,14 +57,23 @@ define([], function () {
rows = [],
row,
i;
function copyDomainsToRow(row, index) {
domains.forEach(function (domain) {
row[domain.name] = series.getDomainValue(index, domain.key);
});
}
function copyRangesToRow(row, index) {
ranges.forEach(function (range) {
row[range.name] = series.getRangeValue(index, range.key);
});
}
for (i = 0; i < series.getPointCount(); i += 1) {
row = {};
domains.forEach(function (domain) {
row[domain.name] = series.getDomainValue(i, domain.key);
});
ranges.forEach(function (range) {
row[range.name] = series.getRangeValue(i, range.key);
});
copyDomainsToRow(row, i);
copyRangesToRow(row, i);
rows.push(row);
}
exportService.exportCSV(rows, { headers: headers });
@ -77,4 +86,4 @@ define([], function () {
};
return ExportTelemetryAsCSVAction;
});
});