19
19
// build HTML
20
20
this . $el = $el ;
21
21
22
- this . $el . wrap ( '<div class=highlightTextarea></div>' ) ;
22
+ this . $el . wrap ( '<div class=" highlightTextarea" ></div>' ) ;
23
23
this . $main = this . $el . parent ( ) ;
24
24
25
- this . $main . prepend ( '<div class=container><div class=highlighter></div></div>' ) ;
25
+ this . $main . prepend ( '<div class="highlightTextarea- container" ><div class="highlightTextarea- highlighter" ></div></div>' ) ;
26
26
this . $container = this . $main . children ( ) . first ( ) ;
27
27
this . $highlighter = this . $container . children ( ) ;
28
28
184
184
185
185
// add triggers to textarea
186
186
this . $el . on ( {
187
- 'input.highlighter ' : Utilities . throttle ( function ( ) {
187
+ 'input.highlightTextarea ' : Utilities . throttle ( function ( ) {
188
188
this . highlight ( ) ;
189
189
} , 100 , this ) ,
190
190
191
- 'resize.highlighter ' : Utilities . throttle ( function ( ) {
191
+ 'resize.highlightTextarea ' : Utilities . throttle ( function ( ) {
192
192
this . updateSizePosition ( true ) ;
193
193
} , 50 , this ) ,
194
194
195
- 'scroll.highlighter select.highlighter ' : Utilities . throttle ( function ( ) {
195
+ 'scroll.highlightTextarea select.highlightTextarea ' : Utilities . throttle ( function ( ) {
196
196
this . updateSizePosition ( ) ;
197
197
} , 50 , this )
198
198
} ) ;
199
199
200
200
if ( this . isInput ) {
201
201
this . $el . on ( {
202
202
// Prevent Cmd-Left Arrow and Cmd-Right Arrow on Mac strange behavior
203
- 'keydown.highlighter keypress.highlighter keyup.highlighter ' : function ( ) {
203
+ 'keydown.highlightTextarea keypress.highlightTextarea keyup.highlightTextarea ' : function ( ) {
204
204
setTimeout ( $ . proxy ( that . updateSizePosition , that ) , 1 ) ;
205
205
} ,
206
206
207
207
// Force Chrome behavior on all browsers: reset input position on blur
208
- 'blur.highlighter ' : function ( ) {
208
+ 'blur.highlightTextarea ' : function ( ) {
209
209
this . value = this . value ;
210
210
this . scrollLeft = 0 ;
211
211
that . updateSizePosition . call ( that ) ;
223
223
}
224
224
this . active = false ;
225
225
226
- this . $highlighter . off ( 'click.highlighter' ) ;
227
- this . $el . off ( 'input.highlighter resize.highlighter scroll.highlighter' +
228
- ' keydown.highlighter keypress.highlighter keyup.highlighter' +
229
- ' select.highlighter blur.highlighter' ) ;
226
+ this . $highlighter . off ( '.highlightTextarea' ) ;
227
+ this . $el . off ( '.highlightTextarea' ) ;
230
228
} ;
231
229
232
230
/*
583
581
}
584
582
} ) ;
585
583
} ;
586
- } ( jQuery ) ) ;
584
+ } ( window . jQuery || window . Zepto ) ) ;
0 commit comments