Changeset 28780 for trunk/themes/default/js/ui/jquery.ui.autocomplete.js
- Timestamp:
- Jun 24, 2014, 10:16:59 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/default/js/ui/jquery.ui.autocomplete.js
r20824 r28780 1 1 /*! 2 * jQuery UI Autocomplete 1.10. 12 * jQuery UI Autocomplete 1.10.4 3 3 * http://jqueryui.com 4 4 * 5 * Copyright 201 3jQuery Foundation and other contributors5 * Copyright 2014 jQuery Foundation and other contributors 6 6 * Released under the MIT license. 7 7 * http://jquery.org/license … … 17 17 (function( $, undefined ) { 18 18 19 // used to prevent race conditions with remote data sources20 var requestIndex = 0;21 22 19 $.widget( "ui.autocomplete", { 23 version: "1.10. 1",20 version: "1.10.4", 24 21 defaultElement: "<input>", 25 22 options: { … … 45 42 }, 46 43 44 requestIndex: 0, 47 45 pending: 0, 48 46 … … 78 76 this._on( this.element, { 79 77 keydown: function( event ) { 80 /*jshint maxcomplexity:15*/81 78 if ( this.element.prop( "readOnly" ) ) { 82 79 suppressKeyPress = true; … … 143 140 if ( suppressKeyPress ) { 144 141 suppressKeyPress = false; 145 event.preventDefault(); 142 if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { 143 event.preventDefault(); 144 } 146 145 return; 147 146 } … … 196 195 .appendTo( this._appendTo() ) 197 196 .menu({ 198 // custom key handling for now199 input: $(),200 197 // disable ARIA support, the live region takes care of that 201 198 role: null … … 235 232 }, 236 233 menufocus: function( event, ui ) { 237 // #7024 - Prevent accidental activation of menu items in Firefox 234 // support: Firefox 235 // Prevent accidental activation of menu items in Firefox (#7024 #9118) 238 236 if ( this.isNewMenu ) { 239 237 this.isNewMenu = false; … … 298 296 }) 299 297 .addClass( "ui-helper-hidden-accessible" ) 300 .insert After( this.element );298 .insertBefore( this.element ); 301 299 302 300 // turning off autocomplete prevents the browser from remembering the … … 420 418 421 419 _response: function() { 422 var that = this, 423 index = ++requestIndex; 424 425 return function( content ) { 426 if ( index === requestIndex ) { 427 that.__response( content ); 428 } 429 430 that.pending--; 431 if ( !that.pending ) { 432 that.element.removeClass( "ui-autocomplete-loading" ); 433 } 434 }; 420 var index = ++this.requestIndex; 421 422 return $.proxy(function( content ) { 423 if ( index === this.requestIndex ) { 424 this.__response( content ); 425 } 426 427 this.pending--; 428 if ( !this.pending ) { 429 this.element.removeClass( "ui-autocomplete-loading" ); 430 } 431 }, this ); 435 432 }, 436 433 … … 491 488 var ul = this.menu.element.empty(); 492 489 this._renderMenu( ul, items ); 490 this.isNewMenu = true; 493 491 this.menu.refresh(); 494 492
Note: See TracChangeset
for help on using the changeset viewer.