regenbogenkarte/ts/emergency-button.ts
nachtjasmin e98c3de747
chore: initial fork of the closed-source project
This commit includes all data from the current map, excluding:

- the actual data
- the deployment script to the server

We've added a comprehensive README for newcomers, so that they can
understand what's going on.

Co-authored-by: xenia <xhartmann@posteo.de>
2022-09-04 10:28:56 +02:00

11 lines
458 B
TypeScript

import { NAVIGATE_TO_URI, NEW_TAB_URI } from "./config";
export const setupEmergencyButton = () => {
const btn = <HTMLButtonElement>document.getElementById("emergency-button");
btn?.addEventListener("click", () => {
// The order of these statements below matter. If we replace the location before opening
// the other URL, the "window.open" line would have no effect.
window.open(NEW_TAB_URI, "_blank");
location.replace(NAVIGATE_TO_URI);
});
};