]> source.dussan.org Git - vaadin-framework.git/commitdiff
Merge commit 'b7e184e30f8e5f1456344f3360c7e8e326c5ad2b' into master
authorJonatan Kronqvist <jonatan@vaadin.com>
Tue, 4 Feb 2014 10:51:12 +0000 (12:51 +0200)
committerJonatan Kronqvist <jonatan@vaadin.com>
Tue, 4 Feb 2014 10:51:12 +0000 (12:51 +0200)
Original commit message:
Cleaned up the implementation of VTabsheet.selectPreviousTab()

Conflicts:
client/src/com/vaadin/client/ui/VTabsheet.java

Change-Id: I8798c2f8e5d5922aa4e7d1b9ce2617eaa1c4ab03

1  2 
client/src/com/vaadin/client/ui/VTabsheet.java

index c8b084778f0cf8a862905572c75c68f8410ff98a,85c28218f7d0f614082fdbe80a1e064272cea75f..ceeb3b565a1d575e61fc09869f1eb608ed3924f4
@@@ -1281,27 -1158,15 +1281,24 @@@ public class VTabsheet extends VTabshee
          // Find the previous visible and enabled tab if any.
          do {
              newTabIndex--;
 -        } while (newTabIndex >= 0 && !onTabSelected(newTabIndex));
 +        } while (newTabIndex >= 0 && !canSelectTab(newTabIndex));
  
          if (newTabIndex >= 0) {
 -            activeTabIndex = newTabIndex;
 +            tb.navigateTab(focusedTabIndex, newTabIndex);
 +            focusedTabIndex = newTabIndex;
 +
 +            // If this TabSheet already has focus, set the new selected tab
 +            // as focused.
 +            if (focusedTab != null) {
 +                focusedTab = tb.getTab(focusedTabIndex);
 +                focusedTab.focus();
 +            }
 +
              if (isScrolledTabs()) {
                  // Scroll until the new active tab is visible
-                 int newScrollerIndex = scrollerIndex;
-                 while (tb.getTab(focusedTabIndex).getAbsoluteLeft() < getAbsoluteLeft()
-                         && newScrollerIndex != -1) {
-                     newScrollerIndex = tb.scrollLeft(newScrollerIndex);
+                 while (!tb.getTab(activeTabIndex).isVisible()) {
+                     scrollerIndex = tb.scrollLeft(scrollerIndex);
                  }
-                 scrollerIndex = newScrollerIndex;
                  updateTabScroller();
              }
          }