MCPcopy
hub / github.com/ZToolsCenter/ZTools / updateSelection

Function updateSelection

resources/preload.js:1582–1593  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1580 }
1581
1582 function updateSelection() {
1583 var nodes = listState.container ? listState.container.querySelectorAll('.ztools-li') : []
1584 for (var i = 0; i < nodes.length; i++) {
1585 if (i === listState.selectedIndex) {
1586 nodes[i].classList.add('selected')
1587 } else {
1588 nodes[i].classList.remove('selected')
1589 }
1590 }
1591 var sel = listState.container && listState.container.querySelector('.ztools-li.selected')
1592 if (sel) sel.scrollIntoView({ block: 'nearest' })
1593 }
1594
1595 function updateHeight() {
1596 var container = listState.container

Callers 2

renderItemsFunction · 0.85
handleListKeydownFunction · 0.85

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected