Skip to content

Commit

Permalink
[Table] Send event object after click, hover, hoverOut on cell.
Browse files Browse the repository at this point in the history
	modified:   src/table/table-body.jsx
	modified:   src/table/table.jsx
  • Loading branch information
MaronMariusz authored and Mariusz Maroń committed Feb 5, 2016
1 parent 10fa116 commit 2bed696
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions src/table/table-body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,26 +382,26 @@ const TableBody = React.createClass({
return rows.sort();
},

_onCellClick(e, rowNumber, columnNumber) {
_onCellClick(event, rowNumber, columnNumber) {
e.stopPropagation();
if (this.props.onCellClick) this.props.onCellClick(rowNumber, this._getColumnId(columnNumber));
if (this.props.onCellClick) this.props.onCellClick(rowNumber, this._getColumnId(columnNumber), event);
},

_onCellHover(e, rowNumber, columnNumber) {
if (this.props.onCellHover) this.props.onCellHover(rowNumber, this._getColumnId(columnNumber));
this._onRowHover(e, rowNumber);
_onCellHover(event, rowNumber, columnNumber) {
if (this.props.onCellHover) this.props.onCellHover(rowNumber, this._getColumnId(columnNumber), event);
this._onRowHover(event, rowNumber);
},

_onCellHoverExit(e, rowNumber, columnNumber) {
if (this.props.onCellHoverExit) this.props.onCellHoverExit(rowNumber, this._getColumnId(columnNumber));
this._onRowHoverExit(e, rowNumber);
_onCellHoverExit(event, rowNumber, columnNumber) {
if (this.props.onCellHoverExit) this.props.onCellHoverExit(rowNumber, this._getColumnId(columnNumber), event);
this._onRowHoverExit(event, rowNumber);
},

_onRowHover(e, rowNumber) {
_onRowHover(event, rowNumber) {
if (this.props.onRowHover) this.props.onRowHover(rowNumber);
},

_onRowHoverExit(e, rowNumber) {
_onRowHoverExit(event, rowNumber) {
if (this.props.onRowHoverExit) this.props.onRowHoverExit(rowNumber);
},

Expand Down
12 changes: 6 additions & 6 deletions src/table/table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,16 @@ const Table = React.createClass({
return base;
},

_onCellClick(rowNumber, columnNumber) {
if (this.props.onCellClick) this.props.onCellClick(rowNumber, columnNumber);
_onCellClick(rowNumber, columnNumber, event) {
if (this.props.onCellClick) this.props.onCellClick(rowNumber, columnNumber, event);
},

_onCellHover(rowNumber, columnNumber) {
if (this.props.onCellHover) this.props.onCellHover(rowNumber, columnNumber);
_onCellHover(rowNumber, columnNumber, event) {
if (this.props.onCellHover) this.props.onCellHover(rowNumber, columnNumber, event);
},

_onCellHoverExit(rowNumber, columnNumber) {
if (this.props.onCellHoverExit) this.props.onCellHoverExit(rowNumber, columnNumber);
_onCellHoverExit(rowNumber, columnNumber, event) {
if (this.props.onCellHoverExit) this.props.onCellHoverExit(rowNumber, columnNumber, event);
},

_onRowHover(rowNumber) {
Expand Down

0 comments on commit 2bed696

Please sign in to comment.