Add Go To index input field

This commit is contained in:
Michael Winter 2026-04-20 17:56:53 +02:00
parent 5a1a4f03dd
commit 8f92185e5e

View file

@ -372,6 +372,7 @@
<button id="prevBtn" disabled>← Previous</button>
<span class="index-display">Index: <span id="currentIndex">0</span> / <span id="totalSteps">0</span></span>
<button id="nextBtn" disabled>Next →</button>
<input type="number" id="gotoIndex" min="0" placeholder="Go to" style="width: 50px; margin-left: 10px;">
<span style="margin-left: 20px; border-left: 1px solid #333; padding-left: 20px;">
<button id="rampBtn" class="toggle-btn">RAMP: OFF</button>
<button id="siren1Btn" class="siren-btn">1</button>
@ -1229,6 +1230,19 @@
}
});
// Go to index on Enter
document.getElementById("gotoIndex").addEventListener("keydown", (e) => {
if (e.key === "Enter") {
const idx = parseInt(e.target.value);
if (!isNaN(idx) && idx >= 0 && idx <= totalSteps) {
currentIndex = idx;
panToIndex(currentIndex);
updateUI();
}
e.target.value = '';
}
});
function updateChordPanel(elementId, data) {
const container = document.getElementById(elementId);
container.innerHTML = "";