PageSourceSearch

https://www.sinaihealth.ca/themes/custom/sinai_health/js/remove-id-from-autocomplete.js?tlvi3s

js sinaihealth.ca collected 2026-09-24 19:14:09 UTC 985 bytes, 32 lines download raw bytes

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      if (window.location.href.indexOf('/layout') == -1) {
8        // Remove TID's onload.
9        Drupal.common.remove_tid();
10
11        // Remove TID's onchange.
12        jQuery('body').find('.form-autocomplete').on('autocompleteclose', function() {
13          Drupal.common.remove_tid();
14        });
15      }
16    }
17  };
18
19  Drupal.common = {
20    remove_tid: function () {
21      var field_autocomplete = jQuery('body').find('.form-autocomplete');
22      field_autocomplete.each(function (event, node) {
23        var val = $(this).val();
24        var match = val.match(/\s\(.*?\)/g);
25        if (match) {
26          $(this).data('real-value', val);
27          $(this).val(val.replace(/\s\(.*?\)/g, '' ));
28        }
29      });
30    }
31  };
32})(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.