mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 19:33:46 +08:00
14 lines
334 B
Plaintext
14 lines
334 B
Plaintext
|
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;
|
||
|
}
|
||
|
}
|
||
|
});
|