Skip to content

Commit

Permalink
Merge pull request #120 from wwayne/custom
Browse files Browse the repository at this point in the history
Fix custom event with specific id
  • Loading branch information
wwayne authored Jun 21, 2016
2 parents f5ed788 + 3732095 commit 8bd9aa1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/decorators/customEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

const checkStatus = function (dataEventOff, e) {
const {show} = this.state
const {id} = this.props
const dataIsCapture = e.currentTarget.getAttribute('data-iscapture')
const isCapture = dataIsCapture && dataIsCapture === 'true' || this.props.isCapture
const currentItem = e.currentTarget.getAttribute('currentItem')
Expand All @@ -17,7 +18,7 @@ const checkStatus = function (dataEventOff, e) {
if (!dataEventOff) this.hideTooltip(e)
} else {
e.currentTarget.setAttribute('currentItem', 'true')
setUntargetItems(e.currentTarget, this.getTargetArray())
setUntargetItems(e.currentTarget, this.getTargetArray(id))
this.showTooltip(e)
}
}
Expand Down
3 changes: 2 additions & 1 deletion standalone/react-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ exports.default = function (target) {

var checkStatus = function checkStatus(dataEventOff, e) {
var show = this.state.show;
var id = this.props.id;

var dataIsCapture = e.currentTarget.getAttribute('data-iscapture');
var isCapture = dataIsCapture && dataIsCapture === 'true' || this.props.isCapture;
Expand All @@ -134,7 +135,7 @@ var checkStatus = function checkStatus(dataEventOff, e) {
if (!dataEventOff) this.hideTooltip(e);
} else {
e.currentTarget.setAttribute('currentItem', 'true');
setUntargetItems(e.currentTarget, this.getTargetArray());
setUntargetItems(e.currentTarget, this.getTargetArray(id));
this.showTooltip(e);
}
};
Expand Down
Loading

0 comments on commit 8bd9aa1

Please sign in to comment.