display a loading message when loading

closes #5
This commit is contained in:
Ell 2023-09-25 14:04:19 +02:00
parent 55382cecc2
commit b680280ee3
2 changed files with 3 additions and 2 deletions

View file

@ -72,6 +72,7 @@
display();
function display() {
main.html(`<div class="center-message"><p>Loading...</p></div>`);
let id = getId();
$.ajax({
method: "get",
@ -86,7 +87,7 @@
$(window).scrollTop(element.offset().top);
});
},
error: (r, s, e) => main.html(`<div class="error"><p>Error loading shared note with id <code>${id}</code>: ${e}</p><p><a href="#">Home</a></p></div>`)
error: (r, s, e) => main.html(`<div class="center-message"><p>Error loading shared note with id <code>${id}</code>: ${e}</p><p><a href="#">Home</a></p></div>`)
});
}

View file

@ -57,7 +57,7 @@ h1:hover .header-anchor, h2:hover .header-anchor, h3:hover .header-anchor, h4:ho
line-height: 1.5;
}
.error {
.center-message {
position: absolute;
text-align: center;
left: 50%;