Ignore:
Timestamp:
Jun 24, 2014, 10:16:59 PM (10 years ago)
Author:
rvelices
Message:

upgrade jquery ui from 1.10.1 to 1.10.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/default/js/ui/jquery.ui.autocomplete.js

    r20824 r28780  
    11/*!
    2  * jQuery UI Autocomplete 1.10.1
     2 * jQuery UI Autocomplete 1.10.4
    33 * http://jqueryui.com
    44 *
    5  * Copyright 2013 jQuery Foundation and other contributors
     5 * Copyright 2014 jQuery Foundation and other contributors
    66 * Released under the MIT license.
    77 * http://jquery.org/license
     
    1717(function( $, undefined ) {
    1818
    19 // used to prevent race conditions with remote data sources
    20 var requestIndex = 0;
    21 
    2219$.widget( "ui.autocomplete", {
    23         version: "1.10.1",
     20        version: "1.10.4",
    2421        defaultElement: "<input>",
    2522        options: {
     
    4542        },
    4643
     44        requestIndex: 0,
    4745        pending: 0,
    4846
     
    7876                this._on( this.element, {
    7977                        keydown: function( event ) {
    80                                 /*jshint maxcomplexity:15*/
    8178                                if ( this.element.prop( "readOnly" ) ) {
    8279                                        suppressKeyPress = true;
     
    143140                                if ( suppressKeyPress ) {
    144141                                        suppressKeyPress = false;
    145                                         event.preventDefault();
     142                                        if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
     143                                                event.preventDefault();
     144                                        }
    146145                                        return;
    147146                                }
     
    196195                        .appendTo( this._appendTo() )
    197196                        .menu({
    198                                 // custom key handling for now
    199                                 input: $(),
    200197                                // disable ARIA support, the live region takes care of that
    201198                                role: null
     
    235232                        },
    236233                        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)
    238236                                if ( this.isNewMenu ) {
    239237                                        this.isNewMenu = false;
     
    298296                        })
    299297                        .addClass( "ui-helper-hidden-accessible" )
    300                         .insertAfter( this.element );
     298                        .insertBefore( this.element );
    301299
    302300                // turning off autocomplete prevents the browser from remembering the
     
    420418
    421419        _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 );
    435432        },
    436433
     
    491488                var ul = this.menu.element.empty();
    492489                this._renderMenu( ul, items );
     490                this.isNewMenu = true;
    493491                this.menu.refresh();
    494492
Note: See TracChangeset for help on using the changeset viewer.