@@ -10,7 +10,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
10
10
11
11
import React from 'react' ;
12
12
import SLDSPopover from '../SLDSPopover' ;
13
- import cx from ' classnames' ;
13
+ const classNames = require ( " classnames" ) ;
14
14
15
15
const displayName = "SLDSTooltip" ;
16
16
const propTypes = {
@@ -106,16 +106,17 @@ class SLDSTooltip extends React.Component {
106
106
} ) ;
107
107
}
108
108
109
- getTooltip ( ) {
110
- const style = {
111
- ' slds-popover' : true ,
112
- ' slds-popover--tooltip' : true ,
113
- 'slds-nubbin--top' : this . props . align === 'bottom ' ,
114
- 'slds-nubbin--bottom' : this . props . align === 'top ' ,
115
- 'slds-nubbin--left' : this . props . align === 'right' ,
116
- 'slds-nubbin--right' : this . props . align === 'left'
117
- } ;
109
+ getClassName ( ) {
110
+ return classNames ( this . props . className , "slds-popover" , {
111
+ [ " slds-popover--tooltip" ] : true ,
112
+ [ " slds-nubbin--top" ] : this . props . align === 'bottom' ,
113
+ [ 'slds-nubbin--bottom' ] : this . props . align === 'top ' ,
114
+ [ 'slds-nubbin--left' ] : this . props . align === 'right ' ,
115
+ [ 'slds-nubbin--right' ] : this . props . align === 'left'
116
+ } ) ;
117
+ }
118
118
119
+ getTooltip ( ) {
119
120
return this . state . isOpen ?< SLDSPopover
120
121
key = { this . getHorizontalAlign ( ) + ' ' + this . getVerticalAlign ( ) }
121
122
targetElement = { this . refs . tooltipTarget }
@@ -129,7 +130,7 @@ class SLDSTooltip extends React.Component {
129
130
verticalAlign = { this . getVerticalAlign ( ) }
130
131
flippable = { false }
131
132
onClose = { this . handleCancel . bind ( this ) } >
132
- < div className = { cx ( style ) } role = "tooltip" >
133
+ < div className = { this . getClassName ( ) } role = "tooltip" >
133
134
{ this . getTooltipContent ( ) }
134
135
</ div >
135
136
</ SLDSPopover > :null ;
0 commit comments