diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/tagging/TaggingPanel.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/tagging/TaggingPanel.java index 58cd73853ea..66a007faeba 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/tagging/TaggingPanel.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/tagging/TaggingPanel.java @@ -192,7 +192,13 @@ public class TaggingPanel extends ComponentWithoutSettings tagButtons = new ArrayList(); - taggingPanel = new DockLayoutPanel(Style.Unit.PX); + taggingPanel = new DockLayoutPanel(Style.Unit.PX) { + @Override + public void onResize() { + super.onResize(); + taggingPanel.setWidgetSize(footerPanel, calculateFooterPanelHeight()); + } + }; filterbarAndContentPanel = new HeaderPanel(); tagFooterPanel = new TagFooterPanel(this, sailingService, stringMessages, userService); footerPanel = new ScrollPanel(tagFooterPanel); @@ -705,15 +711,7 @@ public class TaggingPanel extends ComponentWithoutSettings Scheduler.get().scheduleFinally(new RepeatingCommand() { @Override public boolean execute() { - // Default size of 2/3 the TaggingPanel - int height = (int) Math.round(taggingPanel.getOffsetHeight() / 3f * 2f); - // Get actual size of the footerPanel which might be 0 if the browser screwed up - final int vScroll = footerPanel.getWidget().getElement().getScrollHeight(); - if (vScroll != 0) { - height = Math.min(height, vScroll); - } - height = Math.max(200, height); - taggingPanel.setWidgetSize(footerPanel, height); + taggingPanel.setWidgetSize(footerPanel, calculateFooterPanelHeight()); taggingPanel.animate(FOOTERPANEL_ANIMATION_PERIOD_MS); return false; } @@ -728,6 +726,15 @@ public class TaggingPanel extends ComponentWithoutSettings } } + private int calculateFooterPanelHeight() { + // Start with footerPanel content height + int height = footerPanel.getWidget().getElement().getOffsetHeight(); + // Limit size if we take up the entire height of the viewing area + // to make sure we don't get pushed out of it at the top making parts of the footerPanel inaccessible + height = Math.min(height, taggingPanel.getOffsetHeight()); + return height; + } + /** * Checks whether current user has permission to modify public tags. *