Fix alert message overlap upload form

Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
Joe Ma 2023-03-27 22:27:15 +08:00
parent ca47748164
commit 77060d5f20
No known key found for this signature in database
GPG key ID: 7A0ECF5F5EDC587F
2 changed files with 16 additions and 12 deletions

View file

@ -54,9 +54,9 @@ function validate_url(path) {
function show_pop_alert(message, alert_type = 'alert-primary', add_classes = null) {
remove_pop_alert();
$('.navbar').after(jQuery.parseHTML(
$('#alert-container').prepend(jQuery.parseHTML(
`<div class="alert ${alert_type} alert-dismissible position-absolute fade show top-0 start-50 translate-middle-x"
style="margin-top: 80px; max-width: 500px; width: 80%" id="pop_alert" role="alert"> \
style="margin-top: 30px; max-width: 500px; width: 80%" id="pop_alert" role="alert"> \
<div>${message}</div> \
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> \
</div>`,
@ -73,7 +73,7 @@ function remove_pop_alert() {
alert.remove();
}
function build_paste_modal(paste_info, show_qrcode = true, saved = true) {
function build_paste_modal(paste_info, show_qrcode = true, saved = true, build_only = false) {
// Show saved modal
if (!!!paste_info && !!!saved_modal) {
console.err('Invalid call to build_paste_modal().');
@ -107,7 +107,7 @@ function build_paste_modal(paste_info, show_qrcode = true, saved = true) {
});
let modal = new bootstrap.Modal(paste_modal.modal);
if (saved) saved_modal = modal;
modal.show();
if (!build_only) modal.show();
}
$(function () {