1/** 2 * Workaround for .position() behaviour which was changed in jQuery 3.3 3 * @see https://github.com/jquery/api.jquery.com/issues/1081 4 */ 5var Drupal = Drupal || {}; 6 7(function ($, Drupal) { 8 // Overload Drupal.jsAC.prototype.populatePopup 9 if (Drupal.jsAC !== undefined && Drupal.jsAC.prototype.populatePopup !== undefined) { 10 Drupal.jsAC.prototype.populatePopup = function () { 11 var $input = $(this.input); 12 var offset = $input.offset(); 13 var offsetParent = $input.offsetParent().offset(); 14 // Show popup. 15 if (this.popup) { 16 $(this.popup).remove(); 17 } 18 this.selected = false; 19 this.popup = $('<div id="autocomplete"></div>')[0]; 20 this.popup.owner = this; 21 $(this.popup).css({ 22 top: parseInt(offset.top - offsetParent.top + this.input.offsetHeight, 10) + 'px', 23 left: parseInt(offset.left - offsetParent.left, 10) + 'px', 24 width: $input.innerWidth() + 'px', 25 display: 'none' 26 }); 27 $input.before(this.popup); 28 29 // Do search. 30 this.db.owner = this; 31 this.db.search(this.input.value); 32 }; 33 } 34})(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.