MCPcopy Index your code
hub / github.com/zxlie/FeHelper / _selectSearchMatch

Function _selectSearchMatch

apps/json-format/format-lib.js:1206–1220  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

1204 };
1205
1206 let _selectSearchMatch = function (index) {
1207 if (!jsonSearchState.matches.length) {
1208 return _getSearchResultState();
1209 }
1210
1211 let total = jsonSearchState.matches.length;
1212 jsonSearchState.index = (index + total) % total;
1213 $('#jfContent .fh-json-search-active').removeClass('fh-json-search-active');
1214
1215 let target = $(jsonSearchState.matches[jsonSearchState.index]);
1216 target.addClass('fh-json-search-active');
1217 _selectJsonElement(target);
1218
1219 return _getSearchResultState();
1220 };
1221
1222 let _searchJsonNodes = function (query) {
1223 query = String(query || '').trim();

Callers 2

_searchJsonNodesFunction · 0.85
_nextJsonSearchMatchFunction · 0.85

Calls 3

_getSearchResultStateFunction · 0.85
_selectJsonElementFunction · 0.85
$Function · 0.50

Tested by

no test coverage detected