MCPcopy
hub / github.com/rapi-doc/RapiDoc / onAdvancedSearch

Method onAdvancedSearch

src/rapidoc.js:1068–1081  ·  view source on GitHub ↗
(ev, delay)

Source from the content-addressed store, hash-verified

1066
1067 // Event handler for Advanced Search text-inputs and checkboxes
1068 onAdvancedSearch(ev, delay) {
1069 const eventTargetEl = ev.target;
1070 clearTimeout(this.timeoutId);
1071 this.timeoutId = setTimeout(() => {
1072 let searchInputEl;
1073 if (eventTargetEl.type === 'text') {
1074 searchInputEl = eventTargetEl;
1075 } else {
1076 searchInputEl = eventTargetEl.closest('.advanced-search-options').querySelector('input[type=text]');
1077 }
1078 const searchOptions = [...eventTargetEl.closest('.advanced-search-options').querySelectorAll('input:checked')].map((v) => v.id);
1079 this.advancedSearchMatches = advancedSearch(searchInputEl.value, this.resolvedSpec.tags, searchOptions);
1080 }, delay);
1081 }
1082}
1083customElements.define('rapi-doc', RapiDoc);

Callers 1

Calls 2

advancedSearchFunction · 0.90
mapMethod · 0.45

Tested by

no test coverage detected