diff options
author | Juho Nurminen <juho@vaadin.com> | 2014-03-28 11:35:02 +0200 |
---|---|---|
committer | Juho Nurminen <juho@vaadin.com> | 2014-03-28 11:35:02 +0200 |
commit | 62c4c3f9738627ada3f76a7c197749681e29da0e (patch) | |
tree | 179847d26b94ee25f1e861c9af300a06100ece85 /client | |
parent | 22214b0f24612cc80288b8e8471ff555aafcbc6e (diff) | |
parent | 60aa66a629081058f96e672633ded9cc73c292e2 (diff) | |
download | vaadin-framework-62c4c3f9738627ada3f76a7c197749681e29da0e.tar.gz vaadin-framework-62c4c3f9738627ada3f76a7c197749681e29da0e.zip |
Merge commit '60aa66a'
Conflicts:
client/src/com/vaadin/client/ui/VTabsheet.java
Change-Id: I7bda391a0e5678f85c04bd8ff9bfa65ba1c660b9
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VTabsheet.java | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/client/src/com/vaadin/client/ui/VTabsheet.java b/client/src/com/vaadin/client/ui/VTabsheet.java index b9a70ff66a..4da5e4bfe0 100644 --- a/client/src/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/com/vaadin/client/ui/VTabsheet.java @@ -283,6 +283,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, } public void focus() { + getTabsheet().scrollIntoView(this); focusImpl.focus(td); } @@ -1296,14 +1297,6 @@ public class VTabsheet extends VTabsheetBase implements Focusable, focusedTab = tb.getTab(focusedTabIndex); focusedTab.focus(); } - - if (isScrolledTabs()) { - // Scroll until the new focused tab is visible - while (!tb.getTab(focusedTabIndex).isVisible()) { - scrollerIndex = tb.scrollLeft(scrollerIndex); - } - updateTabScroller(); - } } } @@ -1325,15 +1318,20 @@ public class VTabsheet extends VTabsheetBase implements Focusable, focusedTab = tb.getTab(focusedTabIndex); focusedTab.focus(); } + } + } - if (isClippedTabs()) { - // Scroll until the new active tab is completely visible - int newScrollerIndex = scrollerIndex; - while (isClipped(tb.getTab(focusedTabIndex)) - && newScrollerIndex != -1) { - newScrollerIndex = tb.scrollRight(newScrollerIndex); + private void scrollIntoView(Tab tab) { + if (!tab.isHiddenOnServer()) { + if (isClipped(tab)) { + while (isClipped(tab) && scrollerIndex != -1) { + scrollerIndex = tb.scrollRight(scrollerIndex); + } + updateTabScroller(); + } else if (!tab.isVisible()) { + while (!tab.isVisible()) { + scrollerIndex = tb.scrollLeft(scrollerIndex); } - scrollerIndex = newScrollerIndex; updateTabScroller(); } } |