MCPcopy Create free account
hub / github.com/davidkingzyb/SCAST / findNext

Function findNext

js/common.js:546–560  ·  view source on GitHub ↗
(isprev)

Source from the content-addressed store, hash-verified

544
545}
546function findNext(isprev) {
547 var $searchs = document.querySelectorAll('.find_highlight')
548 if($searchs.length==0){
549 find()
550 return
551 }
552 if (isprev) find_index--;
553 else { find_index++; }
554 if (find_index >= $searchs.length) find_index = 0;
555 if (find_index < 0) find_index = $searchs.length - 1;
556 $searchs[find_index].scrollIntoView({ behavior: 'smooth', block: "center" })
557 if ($prev_find) $prev_find.style.color = '#ffb02e'
558 $prev_find = $searchs[find_index]
559 $prev_find.style.color = 'rgb(255, 95, 46)'
560}
561
562window.onkeydown=function(e){
563 if (e.keyCode == 27) {//esc

Callers 1

common.jsFile · 0.85

Calls 1

findFunction · 0.85

Tested by

no test coverage detected