io.gatling.charts.assets.js.ellipsis.js Maven / Gradle / Ivy
The newest version!
function parentId(name) {
return "parent-" + name;
}
function isEllipsed(name) {
const child = document.getElementById(name);
const parent = document.getElementById(parentId(name));
const emptyData = parent.getAttribute("data-content") === "";
const hasOverflow = child.clientWidth < child.scrollWidth;
if (hasOverflow) {
if (emptyData) {
parent.setAttribute("data-content", name);
}
} else {
if (!emptyData) {
parent.setAttribute("data-content", "");
}
}
}
function ellipsedLabel ({ name, parentClass = "", childClass = "" }) {
const child = "" + name + "";
return "" + child + "";
}