Skip to content

Commit 0015727

Browse files
committed
Merge pull request #99 from Kiwka/master
Simplify setting Sstate in the showTooltip
2 parents a3adfd2 + 001d1ea commit 0015727

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,14 @@ class ReactTooltip extends Component {
261261
this.setState({
262262
placeholder: tooltipText,
263263
multilineCount: multilineCount,
264-
place: e.currentTarget.getAttribute('data-place') ? e.currentTarget.getAttribute('data-place') : (this.props.place ? this.props.place : 'top'),
265-
type: e.currentTarget.getAttribute('data-type') ? e.currentTarget.getAttribute('data-type') : (this.props.type ? this.props.type : 'dark'),
266-
effect: e.currentTarget.getAttribute('data-effect') ? e.currentTarget.getAttribute('data-effect') : (this.props.effect ? this.props.effect : 'float'),
267-
offset: e.currentTarget.getAttribute('data-offset') ? e.currentTarget.getAttribute('data-offset') : (this.props.offset ? this.props.offset : {}),
268-
html: e.currentTarget.getAttribute('data-html') ? e.currentTarget.getAttribute('data-html') : (this.props.html ? this.props.html : false),
269-
delayShow: e.currentTarget.getAttribute('data-delay-show') ? e.currentTarget.getAttribute('data-delay-show') : (this.props.delayShow ? this.props.delayShow : 0),
270-
delayHide: e.currentTarget.getAttribute('data-delay-hide') ? e.currentTarget.getAttribute('data-delay-hide') : (this.props.delayHide ? this.props.delayHide : 0),
271-
border: e.currentTarget.getAttribute('data-border') ? (e.currentTarget.getAttribute('data-border') === 'true') : (this.props.border ? this.props.border : false),
264+
place: e.currentTarget.getAttribute('data-place') || this.props.place || 'top',
265+
type: e.currentTarget.getAttribute('data-type') || this.props.type || 'dark',
266+
effect: e.currentTarget.getAttribute('data-effect') || this.props.effect || 'float',
267+
offset: e.currentTarget.getAttribute('data-offset') || this.props.offset || {},
268+
html: e.currentTarget.getAttribute('data-html') || this.props.html || false,
269+
delayShow: e.currentTarget.getAttribute('data-delay-show') || this.props.delayShow || 0,
270+
delayHide: e.currentTarget.getAttribute('data-delay-hide') || this.props.delayHide || 0,
271+
border: e.currentTarget.getAttribute('data-border') === 'true' || this.props.border || false,
272272
extraClass,
273273
multiline
274274
})

0 commit comments

Comments
 (0)