@@ -53,7 +53,7 @@ $.widget( "ui.autocomplete", {
53
53
// events when we know the keydown event was used to modify the
54
54
// search term. #7799
55
55
var suppressKeyPress , suppressKeyPressRepeat , suppressInput ,
56
- nodeName = this . element [ 0 ] . nodeName . toLowerCase ( ) ,
56
+ nodeName = this . element [ 0 ] . nodeName . toLowerCase ( ) ,
57
57
isTextarea = nodeName === "textarea" ,
58
58
isInput = nodeName === "input" ;
59
59
@@ -265,7 +265,7 @@ $.widget( "ui.autocomplete", {
265
265
previous = this . previous ;
266
266
267
267
// only trigger when focus was lost (click on menu)
268
- if ( this . element [ 0 ] !== this . document [ 0 ] . activeElement ) {
268
+ if ( this . element [ 0 ] !== this . document [ 0 ] . activeElement ) {
269
269
this . element . focus ( ) ;
270
270
this . previous = previous ;
271
271
// #6109 - IE triggers two focus events and the second
@@ -342,7 +342,7 @@ $.widget( "ui.autocomplete", {
342
342
}
343
343
344
344
if ( ! element . length ) {
345
- element = this . document [ 0 ] . body ;
345
+ element = this . document [ 0 ] . body ;
346
346
}
347
347
348
348
return element ;
@@ -351,7 +351,7 @@ $.widget( "ui.autocomplete", {
351
351
_initSource : function ( ) {
352
352
var array , url ,
353
353
that = this ;
354
- if ( $ . isArray ( this . options . source ) ) {
354
+ if ( $ . isArray ( this . options . source ) ) {
355
355
array = this . options . source ;
356
356
this . source = function ( request , response ) {
357
357
response ( $ . ui . autocomplete . filter ( array , request . term ) ) ;
@@ -370,7 +370,7 @@ $.widget( "ui.autocomplete", {
370
370
response ( data ) ;
371
371
} ,
372
372
error : function ( ) {
373
- response ( [ ] ) ;
373
+ response ( [ ] ) ;
374
374
}
375
375
} ) ;
376
376
} ;
@@ -466,7 +466,7 @@ $.widget( "ui.autocomplete", {
466
466
467
467
_normalize : function ( items ) {
468
468
// assume all items have the right format when the first item is complete
469
- if ( items . length && items [ 0 ] . label && items [ 0 ] . value ) {
469
+ if ( items . length && items [ 0 ] . label && items [ 0 ] . value ) {
470
470
return items ;
471
471
}
472
472
return $ . map ( items , function ( item ) {
@@ -494,7 +494,7 @@ $.widget( "ui.autocomplete", {
494
494
this . _resizeMenu ( ) ;
495
495
ul . position ( $ . extend ( {
496
496
of : this . element
497
- } , this . options . position ) ) ;
497
+ } , this . options . position ) ) ;
498
498
499
499
if ( this . options . autoFocus ) {
500
500
this . menu . next ( ) ;
@@ -560,11 +560,11 @@ $.widget( "ui.autocomplete", {
560
560
561
561
$ . extend ( $ . ui . autocomplete , {
562
562
escapeRegex : function ( value ) {
563
- return value . replace ( / [ \- \[ \] { } ( ) * + ? . , \\ \^ $ | # \s ] / g, "\\$&" ) ;
563
+ return value . replace ( / [ \- \[ \] { } ( ) * + ? . , \\ \^ $ | # \s ] / g, "\\$&" ) ;
564
564
} ,
565
- filter : function ( array , term ) {
566
- var matcher = new RegExp ( $ . ui . autocomplete . escapeRegex ( term ) , "i" ) ;
567
- return $ . grep ( array , function ( value ) {
565
+ filter : function ( array , term ) {
566
+ var matcher = new RegExp ( $ . ui . autocomplete . escapeRegex ( term ) , "i" ) ;
567
+ return $ . grep ( array , function ( value ) {
568
568
return matcher . test ( value . label || value . value || value ) ;
569
569
} ) ;
570
570
}
0 commit comments