use of elemental2.dom.NodeList in project drools-wb by kiegroup.
the class CoverageReportDonutPresenter method manageChartLabels.
/**
* Scope of this method is to manage the labels inside the Donut chart. The requirements is to:
* - Remove all labels inside any arc of the chart. This is required because the chart current dimension is very
* small and leading to draw these labels in wrongly way.
* To achieve these requirements without a native support of the component, it navigates the <code>container</code>
* DOM to retrieve manually the text tags elements which handle the labels.
*/
private void manageChartLabels() {
NodeList<Element> listE = container.getElementsByTagName("text");
for (int i = 0; i < listE.getLength(); i++) {
Element element = listE.getAt(i);
String className = element.getAttribute("class");
if (element.innerHTML != null && element.innerHTML.endsWith("%") && className.isEmpty()) {
String style = element.getAttribute(STYLE);
element.setAttribute(STYLE, style.concat("display:none;"));
}
}
}
use of elemental2.dom.NodeList in project drools-wb by kiegroup.
the class CoverageReportDonutPresenter method manageChartTooltip.
/**
* Scope of this method is to change C3 native component position to "sticky"
*/
private void manageChartTooltip() {
NodeList<Element> divs = container.getElementsByTagName("div");
for (int i = 0; i < divs.getLength(); i++) {
Element element = divs.getAt(i);
String className = element.getAttribute("class");
if ("c3-tooltip-container".equals(className)) {
String style = element.getAttribute(STYLE);
String replaceStyle = style.replace("absolute", "sticky").concat("position: -webkit-sticky;");
element.setAttribute(STYLE, replaceStyle);
break;
}
}
}
use of elemental2.dom.NodeList in project kie-wb-common by kiegroup.
the class DragAndDropHelper method refreshItemsPosition.
void refreshItemsPosition() {
final NodeList<Element> draggableItems = dragArea.querySelectorAll(DRAGGABLE_ITEM_CLASS);
final int addButtonTop;
if (!Objects.isNull(draggableItems) && draggableItems.length > 0) {
final double itemHeight = getItemHeight((HTMLElement) draggableItems.getAt(0));
addButtonTop = (int) (draggableItems.length * itemHeight);
for (int i = 0; i < draggableItems.length; i++) {
final HTMLElement element = (HTMLElement) draggableItems.getAt(i);
final int top = (int) (position(element) * itemHeight);
setTop(element, top);
}
} else {
addButtonTop = 0;
}
setTop(addButtonContainer, addButtonTop);
}
use of elemental2.dom.NodeList in project kie-wb-common by kiegroup.
the class DataTypeListView method cleanSubTypes.
void cleanSubTypes(final String uuid) {
final String selector = "[" + PARENT_UUID_ATTR + "=\"" + uuid + "\"]";
final NodeList<Element> subDataTypeRows = listItems.querySelectorAll(selector);
for (int i = 0; i < subDataTypeRows.length; i++) {
final Element item = subDataTypeRows.getAt(i);
if (item != null && item.parentNode != null) {
cleanSubTypes(item.getAttribute(UUID_ATTR));
removeDataTypeRow(item);
}
}
}
use of elemental2.dom.NodeList in project kie-wb-common by kiegroup.
the class DataTypeListHighlightHelper method cleanBackgroundLine.
private void cleanBackgroundLine() {
final NodeList<Element> elementNodeList = querySelectorAll("." + LEVEL_BACKGROUND_LINE);
for (int i = 0; i < elementNodeList.length; i++) {
final Element e = elementNodeList.getAt(i);
e.parentNode.removeChild(e);
}
}
Aggregations