summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2015-08-31 22:51:19 +0300
committerTeemu Suo-Anttila <teemusa@vaadin.com>2015-09-14 08:12:54 +0000
commit9e99e3e793ab14c3623f810b53471dde3d9f9816 (patch)
tree6cd00611dc83f101b9d46280c8d10ee8ab4dd634 /client
parent47fe6d931ddd550d35ab87d8a38eed4f3e8c7fff (diff)
downloadvaadin-framework-9e99e3e793ab14c3623f810b53471dde3d9f9816.tar.gz
vaadin-framework-9e99e3e793ab14c3623f810b53471dde3d9f9816.zip
Disable sidebar button when grid is disabled. (#18696)
Change-Id: If334cebd85fcfe9b368b1b360181abaadd5cb4ef
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/widgets/Grid.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java
index 4d1788639c..449cb60cc7 100644
--- a/client/src/com/vaadin/client/widgets/Grid.java
+++ b/client/src/com/vaadin/client/widgets/Grid.java
@@ -3487,7 +3487,7 @@ public class Grid<T> extends ResizeComposite implements
*
* @since 7.5.0
*/
- private static class Sidebar extends Composite {
+ private static class Sidebar extends Composite implements HasEnabled {
private final ClickHandler openCloseButtonHandler = new ClickHandler() {
@@ -3538,6 +3538,9 @@ public class Grid<T> extends ResizeComposite implements
initWidget(rootContainer);
openCloseButton = new Button();
+
+ setEnabled(grid.isEnabled());
+
openCloseButton.addClickHandler(openCloseButtonHandler);
rootContainer.add(openCloseButton);
@@ -3719,6 +3722,20 @@ public class Grid<T> extends ResizeComposite implements
}
});
}
+
+ @Override
+ public boolean isEnabled() {
+ return openCloseButton.isEnabled();
+ }
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ if(!enabled && isOpen()) {
+ close();
+ }
+
+ openCloseButton.setEnabled(enabled);
+ }
}
/**
@@ -5625,6 +5642,8 @@ public class Grid<T> extends ResizeComposite implements
editor.setGridEnabled(enabled);
}
+ sidebar.setEnabled(enabled);
+
getEscalator().setScrollLocked(Direction.VERTICAL,
!enabled || editorOpen);
getEscalator().setScrollLocked(Direction.HORIZONTAL, !enabled);