1/** 2 * @file 3 * Extends autocomplete based on jQuery UI. 4 * 5 * @todo Remove once jQuery UI is no longer used? 6 */ 7 8(function ($, Drupal) { 9 'use strict'; 10 11 // Ensure the input element has a "change" event triggered. This is important 12 // so that summaries in vertical tabs can be updated properly. 13 // @see Drupal.behaviors.formUpdated 14 $(document).on('autocompleteselect', '.form-autocomplete', function (e) { 15 $(e.target).trigger('change.formUpdated'); 16 }); 17 18 // Extend ui.autocomplete widget so it triggers the glyphicon throbber. 19 $.widget('ui.autocomplete', $.ui.autocomplete, { 20 _search: function (value) { 21 this.pending++; 22 Drupal.Ajax.prototype.glyphiconStart(this.element); 23 this.cancelSearch = false; 24 this.source({term: value}, this._response()); 25 }, 26 _response: function () { 27 var index = ++this.requestIndex; 28 return $.proxy(function (content) { 29 if (index === this.requestIndex) this.__response(content); 30 this.pending--; 31 if (!this.pending) Drupal.Ajax.prototype.glyphiconStop(this.element); 32 }, this); 33 } 34 }); 35 36})(jQuery, Drupal);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.