diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2015-04-14 15:39:18 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-04-16 08:44:32 +0000 |
commit | dd550858b9b4300acac8e35159f4c93e7f58d8ed (patch) | |
tree | 34654e20bef89b3eabaa4b24746b9adad1aaef2c /client | |
parent | 4c8ac1b008a9221ecd9e9133dd598435ae4dd8fd (diff) | |
download | vaadin-framework-dd550858b9b4300acac8e35159f4c93e7f58d8ed.tar.gz vaadin-framework-dd550858b9b4300acac8e35159f4c93e7f58d8ed.zip |
Calculate Grid sidebar button height when closed #17412
+ contains Valo theming fixes for all browsers.
+ includes screenshot test for sidebar in Valo
Change-Id: Ic6401057efff7e4d4ab65c46885dda2d995bce5d
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/widgets/Grid.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index f45d8ef3b4..220e83257b 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -3080,6 +3080,7 @@ public class Grid<T> extends ResizeComposite implements removeStyleName("closed"); rootContainer.add(content); } + openCloseButton.setHeight(""); } /** @@ -3090,6 +3091,8 @@ public class Grid<T> extends ResizeComposite implements removeStyleName("opened"); addStyleName("closed"); content.removeFromParent(); + // adjust open button to header height when closed + setHeightToHeaderCellHeight(); } } @@ -3156,6 +3159,23 @@ public class Grid<T> extends ResizeComposite implements } } + private void setHeightToHeaderCellHeight() { + try { + double height = WidgetUtil + .getRequiredHeightBoundingClientRectDouble(grid.escalator + .getHeader().getRowElement(0) + .getFirstChildElement()) + - (WidgetUtil.measureVerticalBorder(getElement()) / 2); + openCloseButton.setHeight(height + "px"); + } catch (NullPointerException npe) { + getLogger() + .warning( + "Got null header first row or first row cell when calculating sidebar button height"); + openCloseButton.setHeight(grid.escalator.getHeader() + .getDefaultRowHeight() + "px"); + } + } + private void updateVisibility() { final boolean hasWidgets = content.getWidgetCount() > 0; final boolean isVisible = isInDOM(); @@ -3166,6 +3186,8 @@ public class Grid<T> extends ResizeComposite implements close(); grid.getElement().appendChild(getElement()); Grid.setParent(this, grid); + // border calculation won't work until attached + setHeightToHeaderCellHeight(); } } |