From 6684f3fce6e90fd0574d7bab63b629554ab03ef6 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 20 Nov 2024 13:31:50 +0000 Subject: Prettified Code! --- webAO/dom/updateBackgroundPreview.ts | 42 +++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'webAO/dom/updateBackgroundPreview.ts') diff --git a/webAO/dom/updateBackgroundPreview.ts b/webAO/dom/updateBackgroundPreview.ts index 659d4cb..61eec58 100644 --- a/webAO/dom/updateBackgroundPreview.ts +++ b/webAO/dom/updateBackgroundPreview.ts @@ -1,29 +1,31 @@ -import { AO_HOST } from '../client/aoHost'; +import { AO_HOST } from "../client/aoHost"; import tryUrls from "../utils/tryUrls"; /** * Update background preview. */ export function updateBackgroundPreview() { - const background_select = ( - document.getElementById("bg_select") - ); - const background_filename = ( - document.getElementById("bg_filename") - ); - const background_preview = ( - document.getElementById("bg_preview") - ); + const background_select = ( + document.getElementById("bg_select") + ); + const background_filename = ( + document.getElementById("bg_filename") + ); + const background_preview = ( + document.getElementById("bg_preview") + ); - if (background_select.selectedIndex === 0) { - background_filename.style.display = "initial"; - } else { - background_filename.style.display = "none"; - } - tryUrls(`${AO_HOST}background/${encodeURI( - background_select.value.toLowerCase() - )}/defenseempty`).then((resp) => { - background_preview.src = resp; - }); + if (background_select.selectedIndex === 0) { + background_filename.style.display = "initial"; + } else { + background_filename.style.display = "none"; + } + tryUrls( + `${AO_HOST}background/${encodeURI( + background_select.value.toLowerCase(), + )}/defenseempty`, + ).then((resp) => { + background_preview.src = resp; + }); } window.updateBackgroundPreview = updateBackgroundPreview; -- cgit