fix chart card header
This commit is contained in:
parent
61ac16c810
commit
ea2ff64358
2 changed files with 5 additions and 1 deletions
|
@ -40,7 +40,7 @@ abstract class Chart<T> extends Composite<Card> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setContent(@NonNull Map<T, Long> map) {
|
public void setContent(@NonNull Map<T, Long> map) {
|
||||||
getContent().removeAll();
|
getContent().removeContent();
|
||||||
getContent().add(createChart(map));
|
getContent().add(createChart(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,10 @@ public class Card extends PolymerTemplate<Card.CardModel> implements HasSize, Ha
|
||||||
getStyle().set("--acrarium-card-header-color", backgroundColor);
|
getStyle().set("--acrarium-card-header-color", backgroundColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeContent() {
|
||||||
|
getChildren().filter(component -> component.getElement().getAttribute("slot") == null).forEach(this::remove);
|
||||||
|
}
|
||||||
|
|
||||||
public interface CardModel extends TemplateModel {
|
public interface CardModel extends TemplateModel {
|
||||||
void setCanCollapse(boolean collapse);
|
void setCanCollapse(boolean collapse);
|
||||||
boolean getCanCollapse();
|
boolean getCanCollapse();
|
||||||
|
|
Loading…
Reference in a new issue