Improve notice dialog

This commit is contained in:
Balakrishnan Balasubramanian 2024-08-12 13:12:49 -04:00
parent 4578e64597
commit 8299da3b27
3 changed files with 11 additions and 5 deletions

View File

@ -45,3 +45,10 @@
border: 5px solid; border: 5px solid;
border-color: red; border-color: red;
} }
#notice_dialog button {
padding-left: 1rem;
padding-right: 1rem;
margin-left: 1rem;
margin-right: 1rem;
}

View File

@ -8,8 +8,7 @@
</head> </head>
<body> <body>
<dialog id="notice_dialog"> <dialog id="notice_dialog">
<p id="notice_p"></p> <form method="dialog"><span id="notice_span"></span><button>X</button></form>
<form><button type="submit" formmethod="dialog">X</button></form>
</dialog> </dialog>
<div class="container"> <div class="container">
<div class="controls"> <div class="controls">

View File

@ -15,7 +15,7 @@ let makeCollageBtn
let albumSelect let albumSelect
/** @type {HTMLParagraphElement} */ /** @type {HTMLParagraphElement} */
let noticeP let noticeSpan
/** @type {HTMLDialogElement} */ /** @type {HTMLDialogElement} */
let noticeDialog let noticeDialog
@ -34,7 +34,7 @@ function main() {
loadPhotosBtn = document.getElementById("load_photos_button") loadPhotosBtn = document.getElementById("load_photos_button")
makeCollageBtn = document.getElementById("make_collage_button") makeCollageBtn = document.getElementById("make_collage_button")
albumSelect = document.getElementById("album_selector") albumSelect = document.getElementById("album_selector")
noticeP = document.getElementById("notice_p") noticeSpan = document.getElementById("notice_span")
noticeDialog = document.getElementById("notice_dialog") noticeDialog = document.getElementById("notice_dialog")
albumPhotosDiv = document.getElementById("album_photos") albumPhotosDiv = document.getElementById("album_photos")
selectedPhotosDiv = document.getElementById("selected_photos") selectedPhotosDiv = document.getElementById("selected_photos")
@ -92,7 +92,7 @@ function closeNotice() {
/** @param {string} notice */ /** @param {string} notice */
function showNotice(notice) { function showNotice(notice) {
noticeP.textContent = notice noticeSpan.textContent = notice
noticeDialog.show() noticeDialog.show()
} }