diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-06-08 13:44:34 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-06-08 14:28:22 +0000 |
commit | ffb4036fe0573c35e759cb89e8b252f5477ecbea (patch) | |
tree | 83495a486032640efb0373397643c012b0ac9e33 /client | |
parent | 4af793d06a0f4a6577aad13403ca7982c6fce224 (diff) | |
download | vaadin-framework-ffb4036fe0573c35e759cb89e8b252f5477ecbea.tar.gz vaadin-framework-ffb4036fe0573c35e759cb89e8b252f5477ecbea.zip |
Fix Grid drag selection with scrolled page (#17895)
Change-Id: I1303781c5a996448e12e86835935702686af3ab7
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java b/client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java index c8a7ceeca3..1e47d3ad6b 100644 --- a/client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java +++ b/client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java @@ -535,10 +535,8 @@ public class MultiSelectionRenderer<T> extends final int topBorder = getBodyClientTop(); final int bottomBorder = getBodyClientBottom(); - final int scrollCompensation = getScrollCompensation(); - topBound = scrollCompensation + topBorder + SCROLL_AREA_GRADIENT_PX; - bottomBound = scrollCompensation + bottomBorder - - SCROLL_AREA_GRADIENT_PX; + topBound = topBorder + SCROLL_AREA_GRADIENT_PX; + bottomBound = bottomBorder - SCROLL_AREA_GRADIENT_PX; gradientArea = SCROLL_AREA_GRADIENT_PX; // modify bounds if they're too tightly packed @@ -551,17 +549,6 @@ public class MultiSelectionRenderer<T> extends } } - private int getScrollCompensation() { - Element cursor = grid.getElement(); - int scroll = 0; - while (cursor != null) { - scroll -= cursor.getScrollTop(); - cursor = cursor.getParentElement(); - } - - return scroll; - } - public void stop() { if (handlerRegistration != null) { handlerRegistration.removeHandler(); @@ -743,15 +730,8 @@ public class MultiSelectionRenderer<T> extends } /** Get the "top" of an element in relation to "client" coordinates. */ - @SuppressWarnings("static-method") private int getClientTop(final Element e) { - Element cursor = e; - int top = 0; - while (cursor != null) { - top += cursor.getOffsetTop(); - cursor = cursor.getOffsetParent(); - } - return top; + return e.getAbsoluteTop(); } private int getBodyClientBottom() { |