mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
16 lines
340 B
JavaScript
16 lines
340 B
JavaScript
import { registerUnbound } from "discourse-common/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;
|
|
}
|
|
}
|
|
});
|