1// https://drupal.stackexchange.com/questions/200498/hide-the-term-id-on-autocomplete-widget/295790#295790 2(function($, Drupal, drupalSettings){ 3 'use strict'; 4 5 Drupal.behaviors.common = { 6 attach: function(context) { 7 // Remove TID's onload. 8 Drupal.common.remove_tid(); 9 10 // Remove TID's onchange. 11 jQuery('body').find('.form-autocomplete').on('autocompleteclose', function() { 12 Drupal.common.remove_tid(); 13 }); 14 } 15 }; 16 17 Drupal.common = { 18 remove_tid: function () { 19 var field_autocomplete = jQuery('body').find('.form-autocomplete'); 20 field_autocomplete.each(function (event, node) { 21 var val = $(this).val(); 22 var match = val.match(/\s\(.*?\)/g); 23 if (match) { 24 $(this).data('real-value', val); 25 $(this).val(val.replace(/\s\(.*?\)/g, '' )); 26 } 27 }); 28 } 29 }; 30})(jQuery, Drupal, drupalSettings);
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.