diff options
author | Artur Signell <artur@vaadin.com> | 2013-09-26 09:28:50 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-09-26 09:28:50 +0300 |
commit | c18b20050d6b04a2c69b3fdfc75ca901b78edc0a (patch) | |
tree | 1d91200782aa20a4fcf331bb0f773070c7cd080a /client/src/com/vaadin | |
parent | 7c5bdce3b4c76e7f19bc46bcaed135d67a94f06a (diff) | |
parent | bd0ae0581f265be57374b236cfe1b71043ab69aa (diff) | |
download | vaadin-framework-c18b20050d6b04a2c69b3fdfc75ca901b78edc0a.tar.gz vaadin-framework-c18b20050d6b04a2c69b3fdfc75ca901b78edc0a.zip |
Merge changes from origin/7.1
7f7dc31 Base files for TB3 tests (#12572)
6b17abe Make it possible to override web driver in tests (#12572)
a682e3b Refactored build scripts to support TB2, TB3 + integration tests (#12572)
e556642 Converted servlet integration tests to TB3 (#12573)
21af0c3 Updated TB3 tests to use Firefox 24 (#12604)
a7583c6 TB3 test for browsers (#12572)
37b8543 Do not add empty package javadoc for new classes
0248b8f Fixes browser detection for IE11 (#12638)
1df28c3 Run TB3 tests also on IE11 (#12631)
a2daf65 Converted TB2 push tests to TB3 (#12580)
d3261d7 Fixes issue with Table not scrolling completely to the end #12651
bd0ae05 Limit the number of tests run concurrently (#12572)
Change-Id: Idb4389aac388b728490a4ffd57d30aee20ea9fe8
Diffstat (limited to 'client/src/com/vaadin')
-rw-r--r-- | client/src/com/vaadin/client/ui/VScrollTable.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 3733ee204a..492730259a 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -176,6 +176,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private int firstRowInViewPort = 0; private int pageLength = 15; private int lastRequestedFirstvisible = 0; // to detect "serverside scroll" + private int firstvisibleOnLastPage = -1; // To detect if the first visible + // is on the last page /** For internal use only. May be removed or replaced in the future. */ public boolean showRowHeaders = false; @@ -1111,8 +1113,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private ScheduledCommand lazyScroller = new ScheduledCommand() { @Override public void execute() { - int offsetTop = measureRowHeightOffset(firstvisible); - scrollBodyPanel.setScrollPosition(offsetTop); + if (firstvisibleOnLastPage > -1) { + scrollBodyPanel + .setScrollPosition(measureRowHeightOffset(firstvisibleOnLastPage)); + } else { + scrollBodyPanel + .setScrollPosition(measureRowHeightOffset(firstvisible)); + } + firstRowInViewPort = firstvisible; } }; @@ -1120,6 +1128,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, public void updateFirstVisibleAndScrollIfNeeded(UIDL uidl) { firstvisible = uidl.hasVariable("firstvisible") ? uidl .getIntVariable("firstvisible") : 0; + firstvisibleOnLastPage = uidl.hasVariable("firstvisibleonlastpage") ? uidl + .getIntVariable("firstvisibleonlastpage") : -1; if (firstvisible != lastRequestedFirstvisible && scrollBody != null) { // received 'surprising' firstvisible from server: scroll there firstRowInViewPort = firstvisible; @@ -2150,18 +2160,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, isNewBody = false; - if (firstvisible > 0) { - // Deferred due to some Firefox oddities - Scheduler.get().scheduleDeferred(new Command() { - - @Override - public void execute() { - scrollBodyPanel - .setScrollPosition(measureRowHeightOffset(firstvisible)); - firstRowInViewPort = firstvisible; - } - }); - } + Scheduler.get().scheduleFinally(lazyScroller); if (enabled) { // Do we need cache rows |