summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuho Nurminen <juho@vaadin.com>2013-11-20 17:08:16 +0200
committerJuho Nurminen <juho@vaadin.com>2013-11-20 17:08:16 +0200
commitb7e184e30f8e5f1456344f3360c7e8e326c5ad2b (patch)
tree44d17e33ccb8a8fb74522f5ed75b235c3a499073
parent23e5683e14489c23708c067fe62e4009914f1a11 (diff)
downloadvaadin-framework-b7e184e30f8e5f1456344f3360c7e8e326c5ad2b.tar.gz
vaadin-framework-b7e184e30f8e5f1456344f3360c7e8e326c5ad2b.zip
Cleaned up the implementation of VTabsheet.selectPreviousTab()
Change-Id: I8e7fef3005173d7647b4dfda31f60978cbf5972a
-rw-r--r--client/src/com/vaadin/client/ui/VTabsheet.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/client/src/com/vaadin/client/ui/VTabsheet.java b/client/src/com/vaadin/client/ui/VTabsheet.java
index 68a685965b..85c28218f7 100644
--- a/client/src/com/vaadin/client/ui/VTabsheet.java
+++ b/client/src/com/vaadin/client/ui/VTabsheet.java
@@ -1164,12 +1164,9 @@ public class VTabsheet extends VTabsheetBase implements Focusable,
activeTabIndex = newTabIndex;
if (isScrolledTabs()) {
// Scroll until the new active tab is visible
- int newScrollerIndex = scrollerIndex;
- while (tb.getTab(activeTabIndex).getAbsoluteLeft() < getAbsoluteLeft()
- && newScrollerIndex != -1) {
- newScrollerIndex = tb.scrollLeft(newScrollerIndex);
+ while (!tb.getTab(activeTabIndex).isVisible()) {
+ scrollerIndex = tb.scrollLeft(scrollerIndex);
}
- scrollerIndex = newScrollerIndex;
updateTabScroller();
}
}