diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-04-20 07:43:49 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-04-20 07:43:49 +0000 |
commit | b412751372655060c5c1a089608ff97ec61eab0f (patch) | |
tree | 17eb24beb6028e2b77353204e175ff396f6eac8f /src/com/vaadin | |
parent | cd0b3f85fb5699af74df6b44dfe089fbeaa15adf (diff) | |
download | vaadin-framework-b412751372655060c5c1a089608ff97ec61eab0f.tar.gz vaadin-framework-b412751372655060c5c1a089608ff97ec61eab0f.zip |
merging fixes from 6.5
svn changeset:18406/svn branch:6.6
Diffstat (limited to 'src/com/vaadin')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTree.java | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java index fb426d58cb..43915af3c9 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java @@ -625,19 +625,6 @@ public class VTree extends SimpleFocusablePanel implements Paintable, // always when clicking an item, focus it setFocusedNode(this, false); - /* - * Also ensure that the Tree itself is also gains focus (TreeNodes - * focus is kind of faked). - */ - // if (BrowserInfo.get().isOpera()) { - /* - * focusing the tree in Opera would scroll long trees up on clicks - */ - // getElement().focus(); - // } else if (!BrowserInfo.get().isIE()) { - // focus(); - // } // else if IE: NOP, IE will give the focus to Tree anyways - ScheduledCommand command = new ScheduledCommand() { public void execute() { @@ -810,7 +797,6 @@ public class VTree extends SimpleFocusablePanel implements Paintable, } else { focusedNode.setFocused(true); } - // focus(); } final MouseEventDetails details = new MouseEventDetails(evt); ScheduledCommand command = new ScheduledCommand() { @@ -855,15 +841,7 @@ public class VTree extends SimpleFocusablePanel implements Paintable, DOM.appendChild(getElement(), ie6compatnode); DOM.sinkEvents(ie6compatnode, Event.ONCLICK); - } // else if (BrowserInfo.get().isOpera()) { - /* - * We need to focus the TreeNode itself to get keyboard navigation - * to work in opera at some level. Actually focusing individual - * TreeNodes would most likely be better option for all browsers, I - * don't dare to to this at bugfix release. MT. - */ - getElement().setTabIndex(-1); - // } + } nodeCaptionDiv = DOM.createDiv(); DOM.setElementProperty(nodeCaptionDiv, "className", CLASSNAME @@ -874,6 +852,12 @@ public class VTree extends SimpleFocusablePanel implements Paintable, DOM.appendChild(nodeCaptionDiv, wrapper); DOM.appendChild(wrapper, nodeCaptionSpan); + /* + * Focus the caption div of the node to get keyboard navigation to + * work without scrolling up or down when focusing a node. + */ + nodeCaptionDiv.setTabIndex(-1); + childNodeContainer = new FlowPanel(); childNodeContainer.setStyleName(CLASSNAME + "-children"); setWidget(childNodeContainer); @@ -1165,7 +1149,7 @@ public class VTree extends SimpleFocusablePanel implements Paintable, ie6compatnode.addClassName(CLASSNAME_FOCUSED); } this.focused = focused; - getElement().focus(); + nodeCaptionDiv.focus(); treeHasFocus = true; } else if (this.focused && !focused) { nodeCaptionDiv.removeClassName(CLASSNAME_FOCUSED); |