discourse/app/assets/javascripts/admin/helpers/value-at-tl.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
340 B
JavaScript
Raw Normal View History

import { registerUnbound } from "discourse-common/lib/helpers";
2014-12-13 02:28:20 +08:00
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;
}
}
});