discourse/app/assets/javascripts/admin/helpers/value-at-tl.js.es6
2014-12-17 09:31:42 -05:00

13 lines
334 B
JavaScript

import registerUnbound from 'discourse/helpers/register-unbound';
registerUnbound('value-at-tl', function(data, params) {
var tl = parseInt(params.level, 10);
if (data) {
var item = data.find( function(d) { return parseInt(d.x, 10) === tl; } );
if (item) {
return item.y;
} else {
return 0;
}
}
});