feat: added ROM info modal
This commit is contained in:
@@ -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');
|
||||
}
|
Reference in New Issue
Block a user