aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/terminal/gwt/client/Util.java
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2012-02-03 15:00:39 +0000
committerArtur Signell <artur.signell@itmill.com>2012-02-03 15:00:39 +0000
commit798edf80a978b6357147f5c38b7e817b5373d432 (patch)
treeca1492d4aee3f9afcf4d100b73521bb34bfa2573 /src/com/vaadin/terminal/gwt/client/Util.java
parenta4ee6072909e721a6062a3127421e44e88cf2271 (diff)
downloadvaadin-framework-798edf80a978b6357147f5c38b7e817b5373d432.tar.gz
vaadin-framework-798edf80a978b6357147f5c38b7e817b5373d432.zip
#8284, #8336 Fixed header and footer click for right and middle click. Browser context menu is also disabled on right click when there is a click listener.
svn changeset:22887/svn branch:6.7
Diffstat (limited to 'src/com/vaadin/terminal/gwt/client/Util.java')
-rw-r--r--src/com/vaadin/terminal/gwt/client/Util.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java
index 3dbbd22329..60afcc2839 100644
--- a/src/com/vaadin/terminal/gwt/client/Util.java
+++ b/src/com/vaadin/terminal/gwt/client/Util.java
@@ -1321,4 +1321,18 @@ public class Util {
cur = cur.parentNode;
}
}-*/;
+
+ /**
+ * Checks if the given event is either a touch event or caused by the left
+ * mouse button
+ *
+ * @param event
+ * @return true if the event is a touch event or caused by the left mouse
+ * button, false otherwise
+ */
+ public static boolean isTouchEventOrLeftMouseButton(Event event) {
+ int eventType = event.getTypeInt();
+ boolean touchEvent = Util.isTouchEvent(event);
+ return touchEvent || event.getButton() == Event.BUTTON_LEFT;
+ }
}