Skip to content

Commit

Permalink
Restrict badges to view-parts with no toolbar items
Browse files Browse the repository at this point in the history
Signed-off-by: Alvaro Sanchez-Leon <alvaro.sanchez-leon@ericsson.com>
  • Loading branch information
alvsan09 committed Jun 10, 2022
1 parent 36d8696 commit 3b38e20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/browser/view-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1182,8 +1182,9 @@ export class ViewContainerPart extends BaseWidget {
description.innerText = DescriptionWidget.is(this.wrapped) && !this.collapsed && this.wrapped.description || '';
};
const updateBadge = () => {
const visibleToolBarItems = this.toolbarRegistry.visibleItems(this.wrapped).length > 0;
const badge = BadgeWidget.is(this.wrapped) && this.wrapped.badge;
if (badge) {
if (badge && !visibleToolBarItems) {
badgeSpan.innerText = badge.toString();
badgeContainer.style.display = badgeContainerDisplay;
} else {
Expand Down

0 comments on commit 3b38e20

Please sign in to comment.