diff options
author | Artur Signell <artur.signell@itmill.com> | 2012-02-03 15:00:39 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2012-02-03 15:00:39 +0000 |
commit | 798edf80a978b6357147f5c38b7e817b5373d432 (patch) | |
tree | ca1492d4aee3f9afcf4d100b73521bb34bfa2573 /src/com/vaadin/terminal/gwt/client/Util.java | |
parent | a4ee6072909e721a6062a3127421e44e88cf2271 (diff) | |
download | vaadin-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.java | 14 |
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; + } } |