@@ -29,18 +29,18 @@ export default class CommentForm extends BaseComponent {
2929 } ;
3030
3131 _ . bindAll ( this , [
32- '_handleSelect ' ,
33- '_handleChange ' ,
34- '_handleSubmit ' ,
35- '_resetAndFocus ' ,
32+ 'handleSelect ' ,
33+ 'handleChange ' ,
34+ 'handleSubmit ' ,
35+ 'resetAndFocus ' ,
3636 ] ) ;
3737 }
3838
39- _handleSelect ( selectedKey ) {
39+ handleSelect ( selectedKey ) {
4040 this . setState ( { formMode : selectedKey } ) ;
4141 }
4242
43- _handleChange ( ) {
43+ handleChange ( ) {
4444 let comment ;
4545
4646 switch ( this . state . formMode ) {
@@ -71,15 +71,15 @@ export default class CommentForm extends BaseComponent {
7171 this . setState ( { comment } ) ;
7272 }
7373
74- _handleSubmit ( e ) {
74+ handleSubmit ( e ) {
7575 e . preventDefault ( ) ;
7676 const { actions } = this . props ;
7777 actions
7878 . submitComment ( this . state . comment )
79- . then ( this . _resetAndFocus ) ;
79+ . then ( this . resetAndFocus ) ;
8080 }
8181
82- _resetAndFocus ( ) {
82+ resetAndFocus ( ) {
8383 // Don't reset a form that didn't submit, this results in data loss
8484 if ( this . props . error ) return ;
8585
@@ -104,11 +104,11 @@ export default class CommentForm extends BaseComponent {
104104 ref . focus ( ) ;
105105 }
106106
107- _formHorizontal ( ) {
107+ formHorizontal ( ) {
108108 return (
109109 < div >
110110 < hr />
111- < form className = "commentForm form-horizontal" onSubmit = { this . _handleSubmit } >
111+ < form className = "commentForm form-horizontal" onSubmit = { this . handleSubmit } >
112112 < Input
113113 type = "text"
114114 label = "Name"
@@ -117,7 +117,7 @@ export default class CommentForm extends BaseComponent {
117117 wrapperClassName = "col-sm-10"
118118 ref = { node => { this . horizontalAuthorNode = node ; } }
119119 value = { this . state . comment . author }
120- onChange = { this . _handleChange }
120+ onChange = { this . handleChange }
121121 disabled = { this . props . isSaving }
122122 />
123123 < Input
@@ -128,7 +128,7 @@ export default class CommentForm extends BaseComponent {
128128 wrapperClassName = "col-sm-10"
129129 ref = { node => { this . horizontalTextNode = node ; } }
130130 value = { this . state . comment . text }
131- onChange = { this . _handleChange }
131+ onChange = { this . handleChange }
132132 disabled = { this . props . isSaving }
133133 />
134134 < div className = "form-group" >
@@ -146,18 +146,18 @@ export default class CommentForm extends BaseComponent {
146146 ) ;
147147 }
148148
149- _formStacked ( ) {
149+ formStacked ( ) {
150150 return (
151151 < div >
152152 < hr />
153- < form className = "commentForm form" onSubmit = { this . _handleSubmit } >
153+ < form className = "commentForm form" onSubmit = { this . handleSubmit } >
154154 < Input
155155 type = "text"
156156 label = "Name"
157157 placeholder = "Your Name"
158158 ref = { node => { this . stackedAuthorNode = node ; } }
159159 value = { this . state . comment . author }
160- onChange = { this . _handleChange }
160+ onChange = { this . handleChange }
161161 disabled = { this . props . isSaving }
162162 />
163163 < Input
@@ -166,7 +166,7 @@ export default class CommentForm extends BaseComponent {
166166 placeholder = { textPlaceholder }
167167 ref = { node => { this . stackedTextNode = node ; } }
168168 value = { this . state . comment . text }
169- onChange = { this . _handleChange }
169+ onChange = { this . handleChange }
170170 disabled = { this . props . isSaving }
171171 />
172172 < input
@@ -180,11 +180,11 @@ export default class CommentForm extends BaseComponent {
180180 ) ;
181181 }
182182
183- _formInline ( ) {
183+ formInline ( ) {
184184 return (
185185 < div >
186186 < hr />
187- < form className = "commentForm form" onSubmit = { this . _handleSubmit } >
187+ < form className = "commentForm form" onSubmit = { this . handleSubmit } >
188188 < Input label = "Inline Form" wrapperClassName = "wrapper" >
189189 < Row >
190190 < Col xs = { 3 } >
@@ -194,7 +194,7 @@ export default class CommentForm extends BaseComponent {
194194 placeholder = "Your Name"
195195 ref = { node => { this . inlineAuthorNode = node ; } }
196196 value = { this . state . comment . author }
197- onChange = { this . _handleChange }
197+ onChange = { this . handleChange }
198198 disabled = { this . props . isSaving }
199199 />
200200 </ Col >
@@ -205,7 +205,7 @@ export default class CommentForm extends BaseComponent {
205205 placeholder = { textPlaceholder }
206206 ref = { node => { this . inlineTextNode = node ; } }
207207 value = { this . state . comment . text }
208- onChange = { this . _handleChange }
208+ onChange = { this . handleChange }
209209 disabled = { this . props . isSaving }
210210 />
211211 </ Col >
@@ -224,7 +224,7 @@ export default class CommentForm extends BaseComponent {
224224 ) ;
225225 }
226226
227- _errorWarning ( ) {
227+ errorWarning ( ) {
228228 // If there is no error, there is nothing to add to the DOM
229229 if ( ! this . props . error ) return null ;
230230 return (
@@ -239,13 +239,13 @@ export default class CommentForm extends BaseComponent {
239239 let inputForm ;
240240 switch ( this . state . formMode ) {
241241 case 0 :
242- inputForm = this . _formHorizontal ( ) ;
242+ inputForm = this . formHorizontal ( ) ;
243243 break ;
244244 case 1 :
245- inputForm = this . _formStacked ( ) ;
245+ inputForm = this . formStacked ( ) ;
246246 break ;
247247 case 2 :
248- inputForm = this . _formInline ( ) ;
248+ inputForm = this . formInline ( ) ;
249249 break ;
250250 default :
251251 throw new Error ( `Unknown form mode: ${ this . state . formMode } .` ) ;
@@ -260,10 +260,10 @@ export default class CommentForm extends BaseComponent {
260260 transitionEnterTimeout = { 300 }
261261 transitionLeaveTimeout = { 300 }
262262 >
263- { this . _errorWarning ( ) }
263+ { this . errorWarning ( ) }
264264 </ ReactCSSTransitionGroup >
265265
266- < Nav bsStyle = "pills" activeKey = { this . state . formMode } onSelect = { this . _handleSelect } >
266+ < Nav bsStyle = "pills" activeKey = { this . state . formMode } onSelect = { this . handleSelect } >
267267 < NavItem eventKey = { 0 } > Horizontal Form</ NavItem >
268268 < NavItem eventKey = { 1 } > Stacked Form</ NavItem >
269269 < NavItem eventKey = { 2 } > Inline Form</ NavItem >
0 commit comments