Remove auto scrolling when elements are closed

This commit is contained in:
2025-07-26 17:11:09 -04:00
parent b30d2ad682
commit 49c8a6fea5

4
app.js
View File

@@ -12,7 +12,6 @@ document.querySelector('.value-block').addEventListener('toggle', function() {
valueBlock.scrollIntoView({ behavior: "smooth" }); valueBlock.scrollIntoView({ behavior: "smooth" });
} else { } else {
// Scroll to top of button list when value block is closed // Scroll to top of button list when value block is closed
bodyTop.scrollIntoView({ behavior: "smooth" });
} }
}); });
@@ -74,7 +73,6 @@ document.querySelector("#btc-qr-link a").addEventListener("click", function(){
// Display BTC QR code // Display BTC QR code
if (document.contains(document.querySelector("#btc-js-qr"))) { if (document.contains(document.querySelector("#btc-js-qr"))) {
document.querySelector("#btc-js-qr").remove(); document.querySelector("#btc-js-qr").remove();
valueBlock.scrollIntoView({ behavior: "smooth" });
} else { } else {
document.querySelector("#btcwall").insertAdjacentHTML("afterend", "<span class=\"crypto-js-qr\" id=\"btc-js-qr\"><img src=\"images/crypto/btc-qr.png\"></span>"); document.querySelector("#btcwall").insertAdjacentHTML("afterend", "<span class=\"crypto-js-qr\" id=\"btc-js-qr\"><img src=\"images/crypto/btc-qr.png\"></span>");
document.querySelector("#btc-qr-link").scrollIntoView({ behavior: "smooth" }); document.querySelector("#btc-qr-link").scrollIntoView({ behavior: "smooth" });
@@ -93,7 +91,6 @@ document.querySelector("#eth-qr-link a").addEventListener("click", function(){
// Display ETH QR code // Display ETH QR code
if (document.contains(document.querySelector("#eth-js-qr"))) { if (document.contains(document.querySelector("#eth-js-qr"))) {
document.querySelector("#eth-js-qr").remove(); document.querySelector("#eth-js-qr").remove();
valueBlock.scrollIntoView({ behavior: "smooth" });
} else { } else {
document.querySelector("#ethwall").insertAdjacentHTML("afterend", "<span class=\"crypto-js-qr\" id=\"eth-js-qr\"><img src=\"images/crypto/eth-qr.png\"></span>"); document.querySelector("#ethwall").insertAdjacentHTML("afterend", "<span class=\"crypto-js-qr\" id=\"eth-js-qr\"><img src=\"images/crypto/eth-qr.png\"></span>");
document.querySelector("#eth-qr-link").scrollIntoView({ behavior: "smooth" }); document.querySelector("#eth-qr-link").scrollIntoView({ behavior: "smooth" });
@@ -112,7 +109,6 @@ document.querySelector("#doge-qr-link a").addEventListener("click", function(){
// Display DOGE QR code // Display DOGE QR code
if (document.contains(document.querySelector("#doge-js-qr"))) { if (document.contains(document.querySelector("#doge-js-qr"))) {
document.querySelector("#doge-js-qr").remove(); document.querySelector("#doge-js-qr").remove();
valueBlock.scrollIntoView({ behavior: "smooth" });
} else { } else {
document.querySelector("#dogewall").insertAdjacentHTML("afterend", "<span class=\"crypto-js-qr\" id=\"doge-js-qr\"><img src=\"images/crypto/doge-qr.png\"></span>"); document.querySelector("#dogewall").insertAdjacentHTML("afterend", "<span class=\"crypto-js-qr\" id=\"doge-js-qr\"><img src=\"images/crypto/doge-qr.png\"></span>");
document.querySelector("#doge-qr-link").scrollIntoView({ behavior: "smooth" }); document.querySelector("#doge-qr-link").scrollIntoView({ behavior: "smooth" });