Browse Source

Fixes disappearing scrollbar bug (#13334)

Change-Id: I4d956c330d0fe5473911951cc17fd919424aa916
tags/7.4.0.beta1
Henrik Paul 9 years ago
parent
commit
e5589f90c9
1 changed files with 14 additions and 7 deletions
  1. 14
    7
      client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java

+ 14
- 7
client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java View File

@@ -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));
}


Loading…
Cancel
Save