forked from MarseyWorld/MarseyWorld
lazy load bg images in settings
parent
db6db63836
commit
8e04c0c9e2
|
@ -89,7 +89,7 @@ function updatebgselection(){
|
|||
let bgsDir = backgrounds[bgselector.selectedIndex].folder;
|
||||
for (i=0; i < bgsToDisplay.length; i++) {
|
||||
let onclickPost = bgsDir + "/" + bgsToDisplay[i];
|
||||
str += `<button class="btn btn-secondary bg-button"><img class='bg-image' src="/i/backgrounds/${bgsDir}/${bgsToDisplay[i]}?v=2000" alt="${bgsToDisplay[i]}-background" data-nonce="${nonce}" data-onclick="post('/settings/personal?background=${onclickPost}')"></button>`;
|
||||
str += `<button class="btn btn-secondary bg-button"><img loading="lazy" class='bg-image' src="/i/backgrounds/${bgsDir}/${bgsToDisplay[i]}?v=2000" alt="${bgsToDisplay[i]}-background" data-nonce="${nonce}" data-onclick="post('/settings/personal?background=${onclickPost}')"></button>`;
|
||||
}
|
||||
bgContainer.innerHTML = str;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue