This repository was archived by the owner on Nov 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
core/src/plugins/gui.ajax/res/js/ui/reactjs/jsx Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 655
655
656
656
propTypes : {
657
657
label :React . PropTypes . string ,
658
+ labelElement :React . PropTypes . object ,
658
659
tooltip :React . PropTypes . string ,
659
660
tooltipClassName :React . PropTypes . string ,
660
661
className :React . PropTypes . string ,
670
671
671
672
render :function ( ) {
672
673
if ( this . props . tooltip ) {
673
- var tooltipStyle = { } ;
674
- if ( this . props . label ) {
674
+ let tooltipStyle = { } ;
675
+ if ( this . props . label || this . props . labelElement ) {
675
676
if ( this . state . show ) {
676
677
tooltipStyle = { bottom : - 10 , top : 'inherit' } ;
677
678
}
678
679
} else {
679
680
tooltipStyle = { position :'relative' } ;
680
681
}
681
- var label ;
682
+ let label ;
682
683
if ( this . props . label ) {
683
684
label = < span className = "ellipsis-label" > { this . props . label } </ span > ;
685
+ } else if ( this . props . labelElement ) {
686
+ label = this . props . labelElement ;
684
687
}
685
- var style = this . props . style || { position :'relative' } ;
688
+ let style = this . props . style || { position :'relative' } ;
686
689
687
690
return (
688
691
< span onMouseEnter = { this . show } onMouseLeave = { this . hide } style = { style } className = { this . props . className } >
692
695
</ span >
693
696
) ;
694
697
} else {
695
- if ( this . props . label ) return ( < span > { this . props . label } </ span > ) ;
696
- else return ( < span > this.props.children</ span > ) ;
698
+ if ( this . props . label ) {
699
+ return < span > { this . props . label } </ span > ;
700
+ } else if ( this . props . labelElement ) {
701
+ return this . props . labelElement ;
702
+ } else {
703
+ return < span > { this . props . children } </ span > ;
704
+ }
697
705
}
698
706
}
699
707
You can’t perform that action at this time.
0 commit comments