@@ -178,7 +178,7 @@ class TextareaView extends DescriptionView {
178
178
this . update ( ) ; // Set defaults.
179
179
180
180
this . listenTo ( this . model , 'change:placeholder' ,
181
- function ( model , value , options ) {
181
+ ( model , value , options ) => {
182
182
this . update_placeholder ( value ) ;
183
183
} ) ;
184
184
@@ -211,10 +211,10 @@ class TextareaView extends DescriptionView {
211
211
212
212
events ( ) {
213
213
return {
214
- 'keydown input' : 'handleKeyDown' ,
215
- 'keypress input' : 'handleKeypress' ,
216
- 'input textarea' : 'handleChanging' ,
217
- 'change textarea' : 'handleChanged'
214
+ 'keydown input' : 'handleKeyDown' ,
215
+ 'keypress input' : 'handleKeypress' ,
216
+ 'input textarea' : 'handleChanging' ,
217
+ 'change textarea' : 'handleChanged'
218
218
} ;
219
219
}
220
220
@@ -285,7 +285,7 @@ class TextView extends DescriptionView {
285
285
this . el . appendChild ( this . textbox ) ;
286
286
287
287
this . update ( ) ; // Set defaults.
288
- this . listenTo ( this . model , 'change:placeholder' , function ( model , value , options ) {
288
+ this . listenTo ( this . model , 'change:placeholder' , ( model , value , options ) => {
289
289
this . update_placeholder ( value ) ;
290
290
} ) ;
291
291
this . listenTo ( this . model , 'change:description_tooltip' , this . update_title ) ;
@@ -305,9 +305,8 @@ class TextView extends DescriptionView {
305
305
update_title ( ) {
306
306
let title = this . model . get ( 'description_tooltip' ) ;
307
307
if ( ! title ) {
308
- this . textbox . removeAttribute ( 'title' ) ;
309
- }
310
- else if ( this . model . get ( 'description' ) . length === 0 ) {
308
+ this . textbox . removeAttribute ( 'title' ) ;
309
+ } else if ( this . model . get ( 'description' ) . length === 0 ) {
311
310
this . textbox . setAttribute ( 'title' , title ) ;
312
311
}
313
312
}
@@ -319,9 +318,9 @@ class TextView extends DescriptionView {
319
318
* Called when the model is changed. The model may have been
320
319
* changed by another view or by a state update from the back-end.
321
320
*/
322
- if ( options === undefined || options . updated_view != this ) {
323
- if ( this . textbox . value != this . model . get ( 'value' ) ) {
324
- this . textbox . value = this . model . get ( 'value' ) ;
321
+ if ( options === undefined || options . updated_view !== this ) {
322
+ if ( this . textbox . value !== this . model . get ( 'value' ) ) {
323
+ this . textbox . value = this . model . get ( 'value' ) ;
325
324
}
326
325
327
326
this . textbox . disabled = this . model . get ( 'disabled' ) ;
@@ -331,10 +330,10 @@ class TextView extends DescriptionView {
331
330
332
331
events ( ) {
333
332
return {
334
- 'keydown input' : 'handleKeyDown' ,
335
- 'keypress input' : 'handleKeypress' ,
336
- 'input input' : 'handleChanging' ,
337
- 'change input' : 'handleChanged'
333
+ 'keydown input' : 'handleKeyDown' ,
334
+ 'keypress input' : 'handleKeypress' ,
335
+ 'input input' : 'handleChanging' ,
336
+ 'change input' : 'handleChanged'
338
337
} ;
339
338
}
340
339
@@ -353,8 +352,8 @@ class TextView extends DescriptionView {
353
352
handleKeypress ( e ) {
354
353
e . stopPropagation ( ) ;
355
354
// The submit message is deprecated in widgets 7
356
- if ( e . keyCode == 13 ) { // Return key
357
355
this . send ( { event : 'submit' } ) ;
356
+ if ( e . keyCode === 13 ) { // Return key
358
357
}
359
358
}
360
359
0 commit comments