aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java b/client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java
index 59583dcfec..5a54f5fc68 100644
--- a/client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java
+++ b/client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java
@@ -271,13 +271,6 @@ abstract class ScrollbarBundle {
private ScrollbarBundle() {
root.appendChild(scrollSizeElement);
- Event.sinkEvents(root, Event.ONSCROLL);
- Event.setEventListener(root, new EventListener() {
- @Override
- public void onBrowserEvent(Event event) {
- invisibleScrollbarTemporaryResizer.show();
- }
- });
}
protected abstract int internalGetScrollSize();
@@ -517,6 +510,20 @@ abstract class ScrollbarBundle {
*/
public final void setScrollbarThickness(int px) {
isInvisibleScrollbar = (px == 0);
+
+ if (isInvisibleScrollbar) {
+ Event.sinkEvents(root, Event.ONSCROLL);
+ Event.setEventListener(root, new EventListener() {
+ @Override
+ public void onBrowserEvent(Event event) {
+ invisibleScrollbarTemporaryResizer.show();
+ }
+ });
+ } else {
+ Event.sinkEvents(root, 0);
+ Event.setEventListener(root, null);
+ }
+
internalSetScrollbarThickness(Math.max(1, px));
}