]> source.dussan.org Git - vaadin-framework.git/commitdiff
#6731 - focus on the node's caption instead of the element in order to avoid unnecess...
authorJonatan Kronqvist <jonatan.kronqvist@itmill.com>
Fri, 8 Apr 2011 12:47:46 +0000 (12:47 +0000)
committerJonatan Kronqvist <jonatan.kronqvist@itmill.com>
Fri, 8 Apr 2011 12:47:46 +0000 (12:47 +0000)
svn changeset:18186/svn branch:6.5

WebContent/VAADIN/themes/base/styles.css
WebContent/VAADIN/themes/base/tree/tree.css
WebContent/VAADIN/themes/liferay/styles.css
WebContent/VAADIN/themes/reindeer/styles.css
WebContent/VAADIN/themes/runo/styles.css
src/com/vaadin/terminal/gwt/client/ui/VTree.java

index a0a9f657f82636b607f2bfb30c6f3b4f043e96f2..7f79c050e936f6707eaf6794c22fc6909d854412 100644 (file)
@@ -1,5 +1,5 @@
-.v-theme-version:after {content:"6_5_5_dev-20110407";}
-.v-theme-version-6_5_5_dev-20110407 {display: none;}
+.v-theme-version:after {content:"6_5_5_dev-20110408";}
+.v-theme-version-6_5_5_dev-20110408 {display: none;}
 /* Automatically compiled css file from subdirectories. */
 
 .v-absolutelayout-wrapper {
@@ -1975,7 +1975,7 @@ textarea.v-textarea-readonly:focus {
        background: transparent url(common/img/sprites.png) no-repeat 5px -37px;
        padding: 1px 0;
 }
-.v-tree-node:focus {
+.v-tree-node-caption:focus {
        outline: none;
 }
 .v-tree-node-expanded {
index aa01cf7770df449523a8bc209b8979a85cb79bbd..9e056dc4d62e9f2483d5f0ba83ced180ddc0589b 100644 (file)
@@ -8,7 +8,7 @@
        background: transparent url(../common/img/sprites.png) no-repeat 5px -37px;
        padding: 1px 0;
 }
-.v-tree-node:focus {
+.v-tree-node-caption:focus {
        outline: none;
 }
 .v-tree-node-expanded {
index 8b13725d0c714b676b9c888d6fb65a40c7d822d0..21573f81e5c74c7c8e643daa5f31c96cc0d94dd6 100644 (file)
@@ -1,5 +1,5 @@
-.v-theme-version:after {content:"6_5_5_dev-20110407";}
-.v-theme-version-6_5_5_dev-20110407 {display: none;}
+.v-theme-version:after {content:"6_5_5_dev-20110408";}
+.v-theme-version-6_5_5_dev-20110408 {display: none;}
 /* Automatically compiled css file from subdirectories. */
 
 .v-absolutelayout-wrapper {
@@ -1975,7 +1975,7 @@ textarea.v-textarea-readonly:focus {
        background: transparent url(../base/common/img/sprites.png) no-repeat 5px -37px;
        padding: 1px 0;
 }
-.v-tree-node:focus {
+.v-tree-node-caption:focus {
        outline: none;
 }
 .v-tree-node-expanded {
index e612bf9a22729190b22787f0095681fdcaededb1..35878cbcf65e3862a87e6bb22f875b8e9f65432b 100644 (file)
@@ -1,5 +1,5 @@
-.v-theme-version:after {content:"6_5_5_dev-20110407";}
-.v-theme-version-6_5_5_dev-20110407 {display: none;}
+.v-theme-version:after {content:"6_5_5_dev-20110408";}
+.v-theme-version-6_5_5_dev-20110408 {display: none;}
 /* Automatically compiled css file from subdirectories. */
 
 .v-absolutelayout-wrapper {
@@ -1975,7 +1975,7 @@ textarea.v-textarea-readonly:focus {
        background: transparent url(../base/common/img/sprites.png) no-repeat 5px -37px;
        padding: 1px 0;
 }
-.v-tree-node:focus {
+.v-tree-node-caption:focus {
        outline: none;
 }
 .v-tree-node-expanded {
index c78cea7699f0cf7bec89a672b3f6deef7d2df8f4..64bf9261ae75228c3fdfa9be2fc7c7b22249fc2c 100644 (file)
@@ -1,5 +1,5 @@
-.v-theme-version:after {content:"6_5_5_dev-20110407";}
-.v-theme-version-6_5_5_dev-20110407 {display: none;}
+.v-theme-version:after {content:"6_5_5_dev-20110408";}
+.v-theme-version-6_5_5_dev-20110408 {display: none;}
 /* Automatically compiled css file from subdirectories. */
 
 .v-absolutelayout-wrapper {
@@ -1975,7 +1975,7 @@ textarea.v-textarea-readonly:focus {
        background: transparent url(../base/common/img/sprites.png) no-repeat 5px -37px;
        padding: 1px 0;
 }
-.v-tree-node:focus {
+.v-tree-node-caption:focus {
        outline: none;
 }
 .v-tree-node-expanded {
index eff589cbc2c0954727ea6bac9ac844c14608cb72..868049bfce548305e4166204a37c45e23be6b0cb 100644 (file)
@@ -823,10 +823,6 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
 
                 DOM.sinkEvents(ie6compatnode, Event.ONCLICK);
             }
-            /*
-             * Focus the TreeNode itself to get keyboard navigation to work.
-             */
-            getElement().setTabIndex(-1);
 
             nodeCaptionDiv = DOM.createDiv();
             DOM.setElementProperty(nodeCaptionDiv, "className", CLASSNAME
@@ -837,6 +833,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);
@@ -1128,7 +1130,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);