1616//>>css.structure: ../themes/base/autocomplete.css
1717//>>css.theme: ../themes/base/theme.css
1818
19- ( function ( factory ) {
19+ ( function ( factory ) {
2020 if ( typeof define === "function" && define . amd ) {
2121
2222 // AMD. Register as an anonymous module.
23- define ( [
23+ define ( [
2424 "jquery" ,
2525 "./core" ,
2626 "./widget" ,
3232 // Browser globals
3333 factory ( jQuery ) ;
3434 }
35- } ( function ( $ ) {
35+ } ( function ( $ ) {
3636
3737$ . widget ( "ui.autocomplete" , {
3838 version : "@VERSION" ,
@@ -203,15 +203,15 @@ $.widget( "ui.autocomplete", {
203203 this . close ( event ) ;
204204 this . _change ( event ) ;
205205 }
206- } ) ;
206+ } ) ;
207207
208208 this . _initSource ( ) ;
209209 this . menu = $ ( "<ul>" )
210210 . appendTo ( this . _appendTo ( ) )
211- . menu ( {
211+ . menu ( {
212212 // disable ARIA support, the live region takes care of that
213213 role : null
214- } )
214+ } )
215215 . hide ( )
216216 . menu ( "instance" ) ;
217217
@@ -224,7 +224,7 @@ $.widget( "ui.autocomplete", {
224224 // IE doesn't prevent moving focus even with event.preventDefault()
225225 // so we set a flag to know when we should ignore the blur event
226226 this . cancelBlur = true ;
227- this . _delay ( function ( ) {
227+ this . _delay ( function ( ) {
228228 delete this . cancelBlur ;
229229
230230 // Support: IE 8 only
@@ -236,24 +236,24 @@ $.widget( "ui.autocomplete", {
236236 if ( this . element [ 0 ] !== $ . ui . safeActiveElement ( this . document [ 0 ] ) ) {
237237 this . element . focus ( ) ;
238238 }
239- } ) ;
239+ } ) ;
240240
241241 // clicking on the scrollbar causes focus to shift to the body
242242 // but we can't detect a mouseup or a click immediately afterward
243243 // so we have to track the next mousedown and close the menu if
244244 // the user clicks somewhere outside of the autocomplete
245245 var menuElement = this . menu . element [ 0 ] ;
246246 if ( ! $ ( event . target ) . closest ( ".ui-menu-item" ) . length ) {
247- this . _delay ( function ( ) {
247+ this . _delay ( function ( ) {
248248 var that = this ;
249249 this . document . one ( "mousedown" , function ( event ) {
250250 if ( event . target !== that . element [ 0 ] &&
251251 event . target !== menuElement &&
252252 ! $ . contains ( menuElement , event . target ) ) {
253253 that . close ( ) ;
254254 }
255- } ) ;
256- } ) ;
255+ } ) ;
256+ } ) ;
257257 }
258258 } ,
259259 menufocus : function ( event , ui ) {
@@ -267,7 +267,7 @@ $.widget( "ui.autocomplete", {
267267
268268 this . document . one ( "mousemove" , function ( ) {
269269 $ ( event . target ) . trigger ( event . originalEvent ) ;
270- } ) ;
270+ } ) ;
271271
272272 return ;
273273 }
@@ -299,10 +299,10 @@ $.widget( "ui.autocomplete", {
299299 // #6109 - IE triggers two focus events and the second
300300 // is asynchronous, so we need to reset the previous
301301 // term synchronously and asynchronously :-(
302- this . _delay ( function ( ) {
302+ this . _delay ( function ( ) {
303303 this . previous = previous ;
304304 this . selectedItem = item ;
305- } ) ;
305+ } ) ;
306306 }
307307
308308 if ( false !== this . _trigger ( "select" , event , { item : item } ) ) {
@@ -315,13 +315,13 @@ $.widget( "ui.autocomplete", {
315315 this . close ( event ) ;
316316 this . selectedItem = item ;
317317 }
318- } ) ;
318+ } ) ;
319319
320320 this . liveRegion = $ ( "<span>" , {
321- role : "status" ,
322- "aria-live" : "assertive" ,
323- "aria-relevant" : "additions"
324- } )
321+ role : "status" ,
322+ "aria-live" : "assertive" ,
323+ "aria-relevant" : "additions"
324+ } )
325325 . appendTo ( this . document [ 0 ] . body ) ;
326326
327327 this . _addClass ( this . liveRegion , null , "ui-helper-hidden-accessible" ) ;
@@ -333,7 +333,7 @@ $.widget( "ui.autocomplete", {
333333 beforeunload : function ( ) {
334334 this . element . removeAttr ( "autocomplete" ) ;
335335 }
336- } ) ;
336+ } ) ;
337337 } ,
338338
339339 _destroy : function ( ) {
@@ -390,17 +390,17 @@ $.widget( "ui.autocomplete", {
390390 if ( that . xhr ) {
391391 that . xhr . abort ( ) ;
392392 }
393- that . xhr = $ . ajax ( {
393+ that . xhr = $ . ajax ( {
394394 url : url ,
395395 data : request ,
396396 dataType : "json" ,
397397 success : function ( data ) {
398398 response ( data ) ;
399399 } ,
400400 error : function ( ) {
401- response ( [ ] ) ;
401+ response ( [ ] ) ;
402402 }
403- } ) ;
403+ } ) ;
404404 } ;
405405 } else {
406406 this . source = this . options . source ;
@@ -409,7 +409,7 @@ $.widget( "ui.autocomplete", {
409409
410410 _searchTimeout : function ( event ) {
411411 clearTimeout ( this . searching ) ;
412- this . searching = this . _delay ( function ( ) {
412+ this . searching = this . _delay ( function ( ) {
413413
414414 // Search if the value has changed, or if the user retypes the same value (see #7434)
415415 var equalValues = this . term === this . _value ( ) ,
@@ -451,7 +451,7 @@ $.widget( "ui.autocomplete", {
451451 _response : function ( ) {
452452 var index = ++ this . requestIndex ;
453453
454- return $ . proxy ( function ( content ) {
454+ return $ . proxy ( function ( content ) {
455455 if ( index === this . requestIndex ) {
456456 this . __response ( content ) ;
457457 }
@@ -512,8 +512,8 @@ $.widget( "ui.autocomplete", {
512512 return $ . extend ( { } , item , {
513513 label : item . label || item . value ,
514514 value : item . value || item . label
515- } ) ;
516- } ) ;
515+ } ) ;
516+ } ) ;
517517 } ,
518518
519519 _suggest : function ( items ) {
@@ -525,7 +525,7 @@ $.widget( "ui.autocomplete", {
525525 // size and position menu
526526 ul . show ( ) ;
527527 this . _resizeMenu ( ) ;
528- ul . position ( $ . extend ( {
528+ ul . position ( $ . extend ( {
529529 of : this . element
530530 } , this . options . position ) ) ;
531531
@@ -548,7 +548,7 @@ $.widget( "ui.autocomplete", {
548548 var that = this ;
549549 $ . each ( items , function ( index , item ) {
550550 that . _renderItemData ( ul , item ) ;
551- } ) ;
551+ } ) ;
552552 } ,
553553
554554 _renderItemData : function ( ul , item ) {
@@ -595,7 +595,7 @@ $.widget( "ui.autocomplete", {
595595 event . preventDefault ( ) ;
596596 }
597597 }
598- } ) ;
598+ } ) ;
599599
600600$ . extend ( $ . ui . autocomplete , {
601601 escapeRegex : function ( value ) {
@@ -605,9 +605,9 @@ $.extend( $.ui.autocomplete, {
605605 var matcher = new RegExp ( $ . ui . autocomplete . escapeRegex ( term ) , "i" ) ;
606606 return $ . grep ( array , function ( value ) {
607607 return matcher . test ( value . label || value . value || value ) ;
608- } ) ;
608+ } ) ;
609609 }
610- } ) ;
610+ } ) ;
611611
612612// live region extension, adding a `messages` option
613613// NOTE: This is an experimental API. We are still investigating
@@ -637,8 +637,8 @@ $.widget( "ui.autocomplete", $.ui.autocomplete, {
637637 this . liveRegion . children ( ) . hide ( ) ;
638638 $ ( "<div>" ) . text ( message ) . appendTo ( this . liveRegion ) ;
639639 }
640- } ) ;
640+ } ) ;
641641
642642return $ . ui . autocomplete ;
643643
644- } ) ) ;
644+ } ) ) ;
0 commit comments