Add comments to app.js

This commit is contained in:
2025-07-24 11:33:38 -04:00
parent 1b5626b477
commit 8720015daa

4
app.js
View File

@@ -1,8 +1,10 @@
// Set expanded value block to a variable
const valueBlock = document.getElementById("value-expanded");
// Watch for the details element to be toggled
document.querySelector('.value-block').addEventListener('toggle', function() {
if (this.open) {
// Code to execute when the details are opened
// Scroll to contents of value block when it is opened
valueBlock.scrollIntoView({ behavior: "smooth" });
}
});