aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2023-04-25 22:29:26 +0200
committerGitHub <noreply@github.com>2023-04-25 22:29:26 +0200
commit9d03e255877cee5db53f9ec45c84ee8ebfe1ed0a (patch)
tree5e73e62f5a68e91c706584b565f7e01a023d7cb3 /webAO
parent7f1fda00c67bb8796ef250a927958d3e642d6322 (diff)
check for animated bgs in preview
Diffstat (limited to 'webAO')
-rw-r--r--webAO/dom/updateBackgroundPreview.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/webAO/dom/updateBackgroundPreview.ts b/webAO/dom/updateBackgroundPreview.ts
index b41ee8f..0daea74 100644
--- a/webAO/dom/updateBackgroundPreview.ts
+++ b/webAO/dom/updateBackgroundPreview.ts
@@ -15,14 +15,13 @@ export function updateBackgroundPreview() {
if (background_select.selectedIndex === 0) {
background_filename.style.display = "initial";
- background_preview.src = `${AO_HOST}background/${encodeURI(
- background_filename.value.toLowerCase()
- )}/defenseempty.png`;
} else {
background_filename.style.display = "none";
- background_preview.src = `${AO_HOST}background/${encodeURI(
- background_select.value.toLowerCase()
- )}/defenseempty.png`;
}
+ tryUrls(`${AO_HOST}background/${encodeURI(
+ background_select.value.toLowerCase()
+ )}/defenseempty`).then((resp) => {
+ background_preview.src = resp;
+ });
}
-window.updateBackgroundPreview = updateBackgroundPreview; \ No newline at end of file
+window.updateBackgroundPreview = updateBackgroundPreview;