summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2012-02-03 15:01:18 +0000
committerArtur Signell <artur.signell@itmill.com>2012-02-03 15:01:18 +0000
commite9d919b130333476311c03f247524f732d02cce9 (patch)
tree5d74ad9c5041dd91d612b3442d29b6c525a0734e /src/com/vaadin
parent798edf80a978b6357147f5c38b7e817b5373d432 (diff)
downloadvaadin-framework-e9d919b130333476311c03f247524f732d02cce9.tar.gz
vaadin-framework-e9d919b130333476311c03f247524f732d02cce9.zip
#8343, #8344 Column resize and sort are now activated only by the left mouse button
svn changeset:22888/svn branch:6.7
Diffstat (limited to 'src/com/vaadin')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
index cff25e00bf..ee9c03d421 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
@@ -2572,7 +2572,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
if (!moved) {
// mouse event was a click to header -> sort column
- if (sortable) {
+ if (sortable && Util.isTouchEventOrLeftMouseButton(event)) {
if (sortColumn.equals(cid)) {
// just toggle order
client.updateVariable(paintableId, "sortascending",
@@ -2610,7 +2610,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
break;
case Event.ONTOUCHMOVE:
case Event.ONMOUSEMOVE:
- if (dragging) {
+ if (dragging && Util.isTouchEventOrLeftMouseButton(event)) {
if (event.getTypeInt() == Event.ONTOUCHMOVE) {
/*
* prevent using this event in e.g. scrolling
@@ -2656,6 +2656,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
private void onResizeEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEDOWN:
+ if (!Util.isTouchEventOrLeftMouseButton(event)) {
+ return;
+ }
isResizing = true;
DOM.setCapture(getElement());
dragStartX = DOM.eventGetClientX(event);
@@ -2664,6 +2667,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
DOM.eventPreventDefault(event);
break;
case Event.ONMOUSEUP:
+ if (!Util.isTouchEventOrLeftMouseButton(event)) {
+ return;
+ }
isResizing = false;
DOM.releaseCapture(getElement());
tHead.disableAutoColumnWidthCalculation(this);
@@ -2678,6 +2684,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
fireColumnResizeEvent(cid, originalWidth, getColWidth(cid));
break;
case Event.ONMOUSEMOVE:
+ if (!Util.isTouchEventOrLeftMouseButton(event)) {
+ return;
+ }
if (isResizing) {
final int deltaX = DOM.eventGetClientX(event) - dragStartX;
if (deltaX == 0) {