]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #5744
authorJohn Alhroos <john.ahlroos@itmill.com>
Tue, 26 Oct 2010 13:34:43 +0000 (13:34 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Tue, 26 Oct 2010 13:34:43 +0000 (13:34 +0000)
svn changeset:15721/svn branch:6.4

src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java

index 8ad782411dffe7e606344232068c35547f78e9eb..7592839af13ff3488577f21ed68bfa751f85a3b0 100644 (file)
@@ -114,6 +114,14 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
      */
     private static final int MULTISELECT_MODE_DEFAULT = 0;
 
+    /**
+     * The simple multiselect mode is what the table used to have before
+     * ctrl/shift selections were added. That is that when this is set clicking
+     * on an item selects/deselects the item and no ctrl/shift selections are
+     * available.
+     */
+    private static final int MULTISELECT_MODE_SIMPLE = 1;
+
     /**
      * multiple of pagelength which component will cache when requesting more
      * rows
@@ -3963,7 +3971,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
                                             deselectAll();
                                         }
                                         toggleSelection();
-                                    } else if (selectMode == SELECT_MODE_SINGLE
+                                    } else if ((selectMode == SELECT_MODE_SINGLE || multiselectmode == MULTISELECT_MODE_SIMPLE)
                                             && nullSelectionAllowed) {
                                         toggleSelection();
                                     }/*
@@ -5011,12 +5019,12 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
         var top = elem.offsetTop;
         var height = elem.offsetHeight;
     
-        if (elem.parentNode != elem.offsetParent) {         
+        if (elem.parentNode != elem.offsetParent) {
           top -= elem.parentNode.offsetTop;
         }
     
         var cur = elem.parentNode;
-        while (cur && (cur.nodeType == 1)) {         
+        while (cur && (cur.nodeType == 1)) {
           if (top < cur.scrollTop) {
             cur.scrollTop = top;
           }
@@ -5025,7 +5033,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
           }
     
           var offsetTop = cur.offsetTop;
-          if (cur.parentNode != cur.offsetParent) {        
+          if (cur.parentNode != cur.offsetParent) {
             offsetTop -= cur.parentNode.offsetTop;
           }