Skip to content

Commit

Permalink
Fix showIndicators option
Browse files Browse the repository at this point in the history
  • Loading branch information
chabou committed Mar 11, 2017
1 parent 3e8bf8b commit d89f68d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,17 +521,23 @@ exports.decorateTerm = (Term, { React, notify }) => {
}

componentDidMount() {
debug('Attach mouse handler');
if (!this.term) {
debug('No term ref');
return;
}
const doc = this.term.getTermDocument();
doc.body.onmouseenter = this.onMouseEnter;
}

onTermRef(term) {
debug('Keep term ref');
this.term = term;
}

render () {
if (!config.showIndicators) {
return React.createElement(Term, this.props);
return React.createElement(Term, Object.assign({}, this.props, {ref: this.onTermRef}));
}
const myCustomChildrenBefore = React.createElement(
'div',
Expand Down

0 comments on commit d89f68d

Please sign in to comment.