mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-08 20:12:23 +00:00
Fixed issue letting TaggingPanel be pushed off screen
This commit is contained in:
1 parent
d90177c7cd
commit
24c5fad1cb
1 file changed
+17
-10
+17
-10
@@ -192,7 +192,13 @@ public class TaggingPanel extends ComponentWithoutSettings
|
||||
|
||||
tagButtons = new ArrayList<TagButton>();
|
||||
|
||||
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.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user