mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-25 07:04:36 +00:00
fixed
This commit is contained in:
+6
-3
@@ -160,11 +160,14 @@ class Client {
|
||||
});
|
||||
|
||||
const TerritoryModal = document.querySelector(
|
||||
"territory-patterns-input",
|
||||
"territory-patterns-modal",
|
||||
) as territoryPatternsModal;
|
||||
const tpButton = document.getElementById("territory-patterns-input_");
|
||||
const tpButton = document.getElementById(
|
||||
"territory-patterns-input-preview-button",
|
||||
);
|
||||
TerritoryModal instanceof territoryPatternsModal;
|
||||
if (tpButton === null) throw new Error("Missing territory-patterns-input_");
|
||||
if (tpButton === null)
|
||||
throw new Error("territory-patterns-input-preview-button");
|
||||
tpButton.addEventListener("click", () => {
|
||||
TerritoryModal.open();
|
||||
});
|
||||
|
||||
@@ -447,7 +447,7 @@ export class SinglePlayerModal extends LitElement {
|
||||
flagInput.getCurrentFlag() === "xx"
|
||||
? ""
|
||||
: flagInput.getCurrentFlag(),
|
||||
pattern: localStorage.getItem("territoryPattern"),
|
||||
pattern: localStorage.getItem("territoryPattern") ?? null,
|
||||
},
|
||||
],
|
||||
config: {
|
||||
|
||||
@@ -4,14 +4,15 @@ import territory_patterns from "../../resources/territory_patterns.json";
|
||||
import "./components/Difficulties";
|
||||
import "./components/Maps";
|
||||
|
||||
@customElement("territory-patterns-input")
|
||||
@customElement("territory-patterns-modal")
|
||||
export class territoryPatternsModal extends LitElement {
|
||||
@query("o-modal") private modalEl!: HTMLElement & {
|
||||
open: () => void;
|
||||
close: () => void;
|
||||
};
|
||||
|
||||
@query("#territory-patterns-input_") private previewButton!: HTMLElement;
|
||||
@query("#territory-patterns-input-preview-button")
|
||||
private previewButton!: HTMLElement;
|
||||
|
||||
@state() private selectedPattern =
|
||||
localStorage.getItem("territoryPattern") || "";
|
||||
|
||||
@@ -262,13 +262,13 @@
|
||||
|
||||
<div class="container__row">
|
||||
<flag-input class="w-[20%] md:w-[15%]"></flag-input>
|
||||
<territory-patterns-input class="w-[50%] md:w-[12%]">
|
||||
<territory-patterns-modal class="w-[50%] md:w-[12%]">
|
||||
<button
|
||||
id="territory-patterns-input_"
|
||||
id="territory-patterns-input-preview-button"
|
||||
class="w-full border p-[4px] rounded-lg flex cursor-pointer border-black/30 dark:border-gray-300/60 bg-white/70 dark:bg-[rgba(55,65,81,0.7)]"
|
||||
title="Pick a pattern!"
|
||||
></button>
|
||||
</territory-patterns-input>
|
||||
</territory-patterns-modal>
|
||||
<username-input class="w-full"></username-input>
|
||||
<news-button class="mt-3"></news-button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user