MCPcopy
hub / github.com/e-oj/Magic-Grid / removeItems

Function removeItems

test/modify-items.js:19–31  ·  view source on GitHub ↗
(numItems = 10)

Source from the content-addressed store, hash-verified

17}
18
19function removeItems(numItems = 10) {
20 const container = document.querySelector(".container");
21 const items = container.children;
22 const lastIndex = items.length - 1;
23 let stopIndex = lastIndex - numItems;
24
25 if (stopIndex < 0) stopIndex = 0;
26
27 for (let i = lastIndex; i > stopIndex; i--){
28 items[i].remove();
29 }
30 magicGrid.positionItems();
31}
32

Callers

nothing calls this directly

Calls 1

positionItemsMethod · 0.80

Tested by

no test coverage detected