MCPcopy Index your code
hub / github.com/cifertech/DisplayKit / selectPreviousElement

Function selectPreviousElement

app.js:5048–5058  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5046}
5047
5048function selectPreviousElement() {
5049 if (elements.length === 0) return;
5050
5051 let currentIndex = -1;
5052 if (selectedId) {
5053 currentIndex = elements.findIndex(el => el.id === selectedId);
5054 }
5055
5056 const prevIndex = currentIndex <= 0 ? elements.length - 1 : currentIndex - 1;
5057 selectElement(elements[prevIndex].id, false);
5058}
5059
5060// Utility function to bring element to front/back
5061function bringToFront(elementId) {

Callers 1

app.jsFile · 0.85

Calls 1

selectElementFunction · 0.85

Tested by

no test coverage detected