Add comments to app.js
This commit is contained in:
1 parent
1b5626b477
commit
8720015daa
1 file changed
+3
-1
@@ -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" });
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user