Skip to content

Commit 6897fb8

Browse files
authored
Merge pull request #68 from EclipseTrading/VC-11025-have-event-for-when-button-clicked-in-cell
VC-11025 create new event for when mouse point in button
2 parents 981bb08 + 4a2c376 commit 6897fb8

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/lib/cellEventFactory.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,12 @@ var cellEventProperties = Object.defineProperties({}, { // all props non-enumera
340340
}
341341
},
342342

343+
mousePointInButton: {
344+
get: function() {
345+
return this.mousePointInLeftClickRect || this.mousePointInCenterClickRect || this.mousePointInRightClickRect;
346+
}
347+
},
348+
343349
getCellEditorMode:{
344350
get: function(){
345351
return this.cellEditorMode

src/lib/dispatchGridEvent.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ module.exports = function(eventName, cancelable, event, primitiveEvent) {
8080
}
8181
if ('mousePointInLeftClickRect' in primitiveEvent
8282
&& 'mousePointInRightClickRect' in primitiveEvent
83-
&& 'mousePointInCenterClickRect' in primitiveEvent) {
83+
&& 'mousePointInCenterClickRect' in primitiveEvent
84+
&& 'mousePointInButton' in primitiveEvent) {
8485
Object.defineProperty(detail, 'mousePointInLeftClickRect', { get: function() { return primitiveEvent.mousePointInLeftClickRect; } });
8586
Object.defineProperty(detail, 'mousePointInCenterClickRect', { get: function() { return primitiveEvent.mousePointInCenterClickRect; } });
8687
Object.defineProperty(detail, 'mousePointInRightClickRect', { get: function() { return primitiveEvent.mousePointInRightClickRect; } });
88+
Object.defineProperty(detail, 'mousePointInButton', { get: function() { return primitiveEvent.mousePointInButton; } });
8789
}
8890
}
8991

0 commit comments

Comments
 (0)