MCPcopy Create free account
hub / github.com/idank/explainshell / drawvisible

Function drawvisible

explainshell/web/static/js/es.js:1144–1166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1142}
1143
1144function drawvisible() {
1145 let viewtop = window.scrollY;
1146 const viewbottom = viewtop + window.innerHeight,
1147 topspace = 80;
1148
1149 viewtop += topspace;
1150
1151 const visible = Array.from(
1152 document.querySelectorAll('#help .help-box'),
1153 ).filter(
1154 (el) => el.offsetParent !== null && inview(viewtop, viewbottom, el),
1155 );
1156
1157 if (visible.length > 0) {
1158 const commandselector = optionsselector(
1159 $(visible),
1160 currentgroup.commandselector,
1161 );
1162 drawgrouplines(commandselector, { topheight: 50, hidepres: false });
1163 } else {
1164 clear();
1165 }
1166}
1167
1168function draw() {
1169 if (affixon()) drawvisible();

Callers 1

drawFunction · 0.85

Calls 5

inviewFunction · 0.85
optionsselectorFunction · 0.85
drawgrouplinesFunction · 0.85
clearFunction · 0.85
$Function · 0.70

Tested by

no test coverage detected