From 5b1b98b27e151dbe16b139da624d298298585690 Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Tue, 26 Oct 2010 13:34:43 +0000 Subject: Fix for #5744 svn changeset:15721/svn branch:6.4 --- src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 8ad782411d..7592839af1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -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; } -- cgit v1.2.3