From 63072972f77048e3659cfb7b442433d23967d03e Mon Sep 17 00:00:00 2001 From: Miroma <136986257+its-miroma@users.noreply.github.com> Date: Fri, 31 May 2024 08:53:09 +0200 Subject: [PATCH 1/2] Fix Java Docs for browsers that block popups --- scripts/src/lib/Documentation.svelte | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/src/lib/Documentation.svelte b/scripts/src/lib/Documentation.svelte index d92268c8..f6912103 100644 --- a/scripts/src/lib/Documentation.svelte +++ b/scripts/src/lib/Documentation.svelte @@ -5,13 +5,14 @@ getLoaderVersions, } from "./Api"; - function handleSelectChange(event: any, project: any) { - const selectedVersion = event.target.value; + function handleSelectChange(event: any, project: any) { + const selectedVersion = event.target.value; - if (selectedVersion.includes("Select")) return; + if (selectedVersion.includes("Select")) return; - window.open(`https://maven.fabricmc.net/docs/${project.prefix}${selectedVersion}/`, '_blank'); - } + url = `https://maven.fabricmc.net/docs/${project.prefix}${selectedVersion}/`; + anchor.click(); + } function filterAndSortVersions( versions: string[], @@ -86,13 +87,14 @@ {:then data} {#each data as project}
- -
+ + + {/each} {:catch error}

Error: {error.message}

From cf8aed81fe31b0ea8cebb7039494f0ad6bedff7b Mon Sep 17 00:00:00 2001 From: Miroma <136986257+its-miroma@users.noreply.github.com> Date: Fri, 31 May 2024 11:20:19 +0200 Subject: [PATCH 2/2] Declare variables --- scripts/src/lib/Documentation.svelte | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/src/lib/Documentation.svelte b/scripts/src/lib/Documentation.svelte index f6912103..eca0b31a 100644 --- a/scripts/src/lib/Documentation.svelte +++ b/scripts/src/lib/Documentation.svelte @@ -5,6 +5,9 @@ getLoaderVersions, } from "./Api"; + let anchor: HTMLAnchorElement; + let url: string; + function handleSelectChange(event: any, project: any) { const selectedVersion = event.target.value; @@ -87,14 +90,14 @@ {:then data} {#each data as project}
- - -
+ + + {/each} {:catch error}

Error: {error.message}