@@ -84,7 +84,7 @@ export default class CommitView {
84
84
scrollPastEnd = { false }
85
85
/>
86
86
{ this . renderHardWrapIcons ( ) }
87
- < button className = "github-CommitView-expandButton icon icon-screen-full"
87
+ < button ref = "expandButton" className = "github-CommitView-expandButton icon icon-screen-full"
88
88
onClick = { this . toggleExpandedCommitMessageEditor }
89
89
/>
90
90
</ div >
@@ -133,7 +133,7 @@ export default class CommitView {
133
133
} ;
134
134
135
135
return (
136
- < div onclick = { this . toggleHardWrap } className = "github-CommitView-hardwrap hard-wrap-icons" >
136
+ < div onclick = { this . toggleHardWrap } ref = "hardWrapButton" className = "github-CommitView-hardwrap hard-wrap-icons" >
137
137
< div className = { cx ( 'icon' , 'no-hardwrap' , 'icon-hardwrap-disabled' , { hidden : notApplicable || hardWrap } ) } >
138
138
< svg width = "16" height = "16" viewBox = "0 0 16 16" xmlns = "http://www.w3.org/2000/svg" >
139
139
< g fill-rule = "evenodd" >
@@ -160,13 +160,11 @@ export default class CommitView {
160
160
}
161
161
162
162
registerTooltips ( ) {
163
- const expandButton = this . element . getElementsByClassName ( 'github-CommitView-expandButton' ) [ 0 ] ;
164
- const hardWrapButton = this . element . getElementsByClassName ( 'github-CommitView-hardwrap' ) [ 0 ] ;
165
- this . expandTooltip = this . props . tooltips . add ( expandButton , {
163
+ this . expandTooltip = this . props . tooltips . add ( this . refs . expandButton , {
166
164
title : 'Expand commit message editor' ,
167
165
class : 'github-CommitView-expandButton-tooltip' ,
168
166
} ) ;
169
- this . hardWrapTooltip = this . props . tooltips . add ( hardWrapButton , {
167
+ this . hardWrapTooltip = this . props . tooltips . add ( this . refs . hardWrapButton , {
170
168
title : 'Toggle hard wrap on commit' ,
171
169
class : 'github-CommitView-hardwrap-tooltip' ,
172
170
} ) ;
0 commit comments