mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 11:32:24 -05:00
13 lines
325 B
JavaScript
13 lines
325 B
JavaScript
import { registerUnbound } from 'discourse/lib/helpers';
|
|
|
|
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;
|
|
}
|
|
}
|
|
});
|