mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-06-16 19:35:24 +02:00
Add a little loading indicator for fetch messages
This commit is contained in:
@ -895,6 +895,23 @@ p.mentioned span.chatmessage {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
#message-spinner {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -30vh;
|
||||
margin-left: -5vw;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#message-spinner > div {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#message-spinner.error > div {
|
||||
background-color: pink;
|
||||
}
|
||||
|
||||
/* CSS Variables */
|
||||
:root {
|
||||
/*--<var>: <value>*/
|
||||
|
@ -1135,6 +1135,7 @@
|
||||
var channel_id = selected_channel;
|
||||
var fet;
|
||||
var jumpscroll;
|
||||
$("#message-spinner").fadeIn();
|
||||
if (last_message_id == null) {
|
||||
$("#chatcontent").empty();
|
||||
fet = fetch(channel_id);
|
||||
@ -1167,6 +1168,8 @@
|
||||
fill_unauthenticated_users(guildobj.embedmembers.unauthenticated);
|
||||
$("#instant-inv").attr("href", guildobj.instant_invite);
|
||||
});
|
||||
$("#message-spinner").removeClass("error");
|
||||
$("#message-spinner").fadeOut();
|
||||
});
|
||||
fet.fail(function(data) {
|
||||
if (data.status == 403) {
|
||||
@ -1177,6 +1180,7 @@
|
||||
Materialize.toast('Session expired! You have been logged out.', 10000);
|
||||
}
|
||||
setVisitorMode(true);
|
||||
$("#message-spinner").addClass("error");
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user