Skip to content

Commit 4894f29

Browse files
committed
Add events for rightclick and doubleclick
1 parent 4b31658 commit 4894f29

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

lib/EventTypes.js

100644100755
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ module.exports = {
77
onTouchMove: 'touchmove',
88
onTouchEnd: 'touchend',
99
onTouchCancel: 'touchcancel',
10-
onClick: 'click'
10+
onClick: 'click',
11+
onContextMenu: 'contextmenu',
12+
onDoubleClick: 'dblclick'
1113
};

lib/Surface.js

100644100755
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ var Surface = React.createClass({
106106
onTouchMove: this.handleTouchMove,
107107
onTouchEnd: this.handleTouchEnd,
108108
onTouchCancel: this.handleTouchEnd,
109-
onClick: this.handleClick})
109+
onClick: this.handleClick,
110+
onContextMenu: this.handleContextMenu,
111+
onDoubleClick: this.handleDoubleClick})
110112
);
111113
},
112114

@@ -212,7 +214,15 @@ var Surface = React.createClass({
212214

213215
handleClick: function (e) {
214216
this.hitTest(e);
215-
}
217+
},
218+
219+
handleContextMenu: function (e) {
220+
this.hitTest(e);
221+
},
222+
223+
handleDoubleClick: function (e) {
224+
this.hitTest(e);
225+
},
216226

217227
});
218228

0 commit comments

Comments
 (0)