feat: added ROM info modal

This commit is contained in:
Michael Green
2023-06-29 07:47:33 +10:00
parent f5cfe9deb6
commit 6377a99583
6 changed files with 194 additions and 3 deletions

View File

@@ -33,4 +33,41 @@ function formatBytes(bytes, decimals = 2) {
const i = Math.floor(Math.log(bytes) / Math.log(k))
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`
}
function showDialog(dialogPage, variables) {
// Get the modal
var modal = document.getElementById("myModal");
// Get the modal content
var modalContent = document.getElementById("modal-content");
// Get the button that opens the modal
var btn = document.getElementById("myBtn");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on the button, open the modal
modal.style.display = "block";
// When the user clicks on <span> (x), close the modal
span.onclick = function () {
modal.style.display = "none";
modalContent.innerHTML = "";
modalVariables = null;
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function (event) {
if (event.target == modal) {
modal.style.display = "none";
modalContent.innerHTML = "";
modalVariables = null;
}
}
modalVariables = variables;
$('#modal-content').load('/pages/dialogs/' + dialogPage + '.html');
}