@DownPW said in [NODEBB] Help for my custom CSS:
It’s ok for duplicate ajax problem but not fixed for the the footer image : It’s appear one time and if you go to another section (like recent or unread for example), the image on footer don’t appear
I kind of expected that because the footer image relies on an ajax
reload to determine the time, then work out which image to display based on that. The real problem here is that the prepend is being called on each request, and because it’s an prepend
, you are seeing multiple copies.
One way to fix this is to delete the element and recreate it, but that is horribly inefficient
I’ve modified the function to include a check to see if the containing div
is empty or not - if it is, we add the icon and message - if it’s already there, we skip it
// Test to see if the DIV containing the icon and message is empty. If it is, insert icon and message
if ($('#busername').length === 0) {
$('.getUsername').prepend("<div id='busername'><i id='thisicon' class='" + theicon + "'></i></div>" + themessage);
} else {
// nothing to do here :)
}
(Note that this has been added to the existing function)
And some minor css
which allows us to float the new div
so that it displays inline
// Inline display fix for Welcome DIV
div#busername {
display: inline;
}