Skip to content

Commit 6a483fd

Browse files
committed
Autocomplete: Whitespace
1 parent 9de1eb0 commit 6a483fd

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

ui/jquery.ui.autocomplete.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ $.widget( "ui.autocomplete", {
5353
// events when we know the keydown event was used to modify the
5454
// search term. #7799
5555
var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
56-
nodeName = this.element[0].nodeName.toLowerCase(),
56+
nodeName = this.element[ 0 ].nodeName.toLowerCase(),
5757
isTextarea = nodeName === "textarea",
5858
isInput = nodeName === "input";
5959

@@ -265,7 +265,7 @@ $.widget( "ui.autocomplete", {
265265
previous = this.previous;
266266

267267
// 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 ) {
269269
this.element.focus();
270270
this.previous = previous;
271271
// #6109 - IE triggers two focus events and the second
@@ -342,7 +342,7 @@ $.widget( "ui.autocomplete", {
342342
}
343343

344344
if ( !element.length ) {
345-
element = this.document[0].body;
345+
element = this.document[ 0 ].body;
346346
}
347347

348348
return element;
@@ -351,7 +351,7 @@ $.widget( "ui.autocomplete", {
351351
_initSource: function() {
352352
var array, url,
353353
that = this;
354-
if ( $.isArray(this.options.source) ) {
354+
if ( $.isArray( this.options.source ) ) {
355355
array = this.options.source;
356356
this.source = function( request, response ) {
357357
response( $.ui.autocomplete.filter( array, request.term ) );
@@ -370,7 +370,7 @@ $.widget( "ui.autocomplete", {
370370
response( data );
371371
},
372372
error: function() {
373-
response( [] );
373+
response([]);
374374
}
375375
});
376376
};
@@ -466,7 +466,7 @@ $.widget( "ui.autocomplete", {
466466

467467
_normalize: function( items ) {
468468
// 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 ) {
470470
return items;
471471
}
472472
return $.map( items, function( item ) {
@@ -494,7 +494,7 @@ $.widget( "ui.autocomplete", {
494494
this._resizeMenu();
495495
ul.position( $.extend({
496496
of: this.element
497-
}, this.options.position ));
497+
}, this.options.position ) );
498498

499499
if ( this.options.autoFocus ) {
500500
this.menu.next();
@@ -560,11 +560,11 @@ $.widget( "ui.autocomplete", {
560560

561561
$.extend( $.ui.autocomplete, {
562562
escapeRegex: function( value ) {
563-
return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
563+
return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
564564
},
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 ) {
568568
return matcher.test( value.label || value.value || value );
569569
});
570570
}

0 commit comments

Comments
 (0)