Skip to content

Commit

Permalink
#3610 - Minimizing icon in document level feature is wrong after upda…
Browse files Browse the repository at this point in the history
…ting feature

- Fix visibility condition
  • Loading branch information
reckart committed Jan 4, 2023
1 parent 797485f commit 6fc2ae9
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ protected void onEvent(AjaxRequestTarget aTarget)
}
});

detailPanel.add(visibleWhen(
() -> selectedAnnotation == container || aItem.getModelObject().singleton));
detailPanel.add(visibleWhen(() -> isExpanded(aItem, container)));

if (createdAnnotationAddress == vid.getId()) {
createdAnnotationAddress = -1;
Expand All @@ -306,14 +305,12 @@ protected void onEvent(AjaxRequestTarget aTarget)
}

WebMarkupContainer close = new WebMarkupContainer("close");
close.add(visibleWhen(
() -> !detailPanel.isVisible() && !aItem.getModelObject().singleton));
close.add(visibleWhen(() -> isExpanded(aItem, container)));
close.setOutputMarkupId(true);
container.add(close);

WebMarkupContainer open = new WebMarkupContainer("open");
open.add(visibleWhen(
() -> detailPanel.isVisible() && !aItem.getModelObject().singleton));
open.add(visibleWhen(() -> !isExpanded(aItem, container)));
open.setOutputMarkupId(true);
container.add(open);

Expand All @@ -332,6 +329,12 @@ protected void onEvent(AjaxRequestTarget aTarget)

aItem.setOutputMarkupId(true);
}

private boolean isExpanded(ListItem<AnnotationListItem> aItem,
WebMarkupContainer container)
{
return selectedAnnotation == container || aItem.getModelObject().singleton;
}
};
}

Expand Down

0 comments on commit 6fc2ae9

Please sign in to comment.