@@ -19,7 +19,7 @@ declare var $: any;
1919 * KeyDown events are also handled to provide handling for Tab, Shift-Tab, Esc and Ctrl-Enter.
2020 */
2121export class LongTextEditor implements Editor {
22- $input : any ;
22+ $textarea : any ;
2323 $wrapper : any ;
2424 defaultValue : any ;
2525
@@ -64,12 +64,12 @@ export class LongTextEditor implements Editor {
6464 const $container = $ ( 'body' ) ;
6565
6666 this . $wrapper = $ ( `<div class="slick-large-editor-text editor-${ columnId } " placeholder="${ placeholder } " />` ) . appendTo ( $container ) ;
67- this . $input = $ ( `<textarea hidefocus rows="5">` ) . appendTo ( this . $wrapper ) ;
67+ this . $textarea = $ ( `<textarea hidefocus rows="5">` ) . appendTo ( this . $wrapper ) ;
6868
6969 // the lib does not get the focus out event for some reason
7070 // so register it here
7171 if ( this . hasAutoCommitEdit ) {
72- this . $input . on ( 'focusout' , ( ) => this . save ( ) ) ;
72+ this . $textarea . on ( 'focusout' , ( ) => this . save ( ) ) ;
7373 }
7474
7575 $ ( `<div class="editor-footer">
@@ -79,10 +79,10 @@ export class LongTextEditor implements Editor {
7979
8080 this . $wrapper . find ( 'button:first' ) . on ( 'click' , ( ) => this . save ( ) ) ;
8181 this . $wrapper . find ( 'button:last' ) . on ( 'click' , ( ) => this . cancel ( ) ) ;
82- this . $input . on ( 'keydown' , this . handleKeyDown . bind ( this ) ) ;
82+ this . $textarea . on ( 'keydown' , this . handleKeyDown . bind ( this ) ) ;
8383
8484 this . position ( this . args && this . args . position ) ;
85- this . $input . focus ( ) . select ( ) ;
85+ this . $textarea . focus ( ) . select ( ) ;
8686 }
8787
8888 handleKeyDown ( e : any ) {
@@ -116,7 +116,7 @@ export class LongTextEditor implements Editor {
116116 }
117117
118118 cancel ( ) {
119- this . $input . val ( this . defaultValue ) ;
119+ this . $textarea . val ( this . defaultValue ) ;
120120 if ( this . args && this . args . cancelChanges ) {
121121 this . args . cancelChanges ( ) ;
122122 }
@@ -141,33 +141,33 @@ export class LongTextEditor implements Editor {
141141 }
142142
143143 focus ( ) {
144- this . $input . focus ( ) ;
144+ this . $textarea . focus ( ) ;
145145 }
146146
147147 getColumnEditor ( ) {
148148 return this . args && this . args . column && this . args . column . internalColumnEditor && this . args . column . internalColumnEditor ;
149149 }
150150
151151 loadValue ( item : any ) {
152- this . $input . val ( this . defaultValue = item [ this . columnDef . field ] ) ;
153- this . $input . select ( ) ;
152+ this . $textarea . val ( this . defaultValue = item [ this . columnDef . field ] ) ;
153+ this . $textarea . select ( ) ;
154154 }
155155
156156 serializeValue ( ) {
157- return this . $input . val ( ) ;
157+ return this . $textarea . val ( ) ;
158158 }
159159
160160 applyValue ( item : any , state : any ) {
161161 item [ this . columnDef . field ] = state ;
162162 }
163163
164164 isValueChanged ( ) {
165- return ( ! ( this . $input . val ( ) === '' && this . defaultValue == null ) ) && ( this . $input . val ( ) !== this . defaultValue ) ;
165+ return ( ! ( this . $textarea . val ( ) === '' && this . defaultValue == null ) ) && ( this . $textarea . val ( ) !== this . defaultValue ) ;
166166 }
167167
168168 validate ( ) : EditorValidatorOutput {
169169 if ( this . validator ) {
170- const value = this . $input && this . $input . val && this . $input . val ( ) ;
170+ const value = this . $textarea && this . $textarea . val && this . $textarea . val ( ) ;
171171 const validationResults = this . validator ( value , this . args ) ;
172172 if ( ! validationResults . valid ) {
173173 return validationResults ;
0 commit comments