Skip to content

Commit

Permalink
fix an issue where the target is a string and the actual target doesn…
Browse files Browse the repository at this point in the history
…'t exist on the page, then the tooltip is removed from the dom
  • Loading branch information
Dan Lasky committed May 26, 2016
1 parent dc54e81 commit a1d6b4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/strand-tooltip/strand-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
this._boundOutHandler = this._outHandler.bind(this);

this.async(function() {
if (this._target) {
if (this._target && typeof this._target === "object") {
this._target.addEventListener('mouseover', this._boundOverHandler);
this._target.addEventListener('mouseout', this._boundOutHandler);
this._prevTargetCursor = this._target.style.cursor;
Expand All @@ -58,7 +58,7 @@
},

detached: function() {
if (this._target) {
if (this._target && typeof this._target === "object") {
this._target.removeEventListener('mouseover', this._boundOverHandler);
this._target.removeEventListener('mouseout', this._boundOutHandler);
this._target.style.cursor = this._prevTargetCursor;
Expand Down

0 comments on commit a1d6b4d

Please sign in to comment.