Skip to content

Commit 937d5c1

Browse files
AzgaarCopilot
andcommitted
refactor: migrate coastline settings editor to TypeScript and update dialog title
Co-authored-by: Copilot <copilot@github.com>
1 parent 65c99d5 commit 937d5c1

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

public/modules/ui/editors.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,8 @@ async function editReligions() {
10071007
Editor.open();
10081008
}
10091009

1010-
async function editCoastlineSettings() {
1010+
// TS-migrated editors. TODO: import from module when editors.js is migrated to TS
1011+
function editCoastlineSettings() {
10111012
if (customization) return;
1012-
const Editor = await import("../dynamic/editors/coastline-editor.js?v=1.118.0");
1013-
Editor.open();
1013+
window.CoastlineEditor.open();
10141014
}

src/controllers/coastline-editor.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ export function open(): void {
113113
closeDialogs("#culturesEditor, .stable");
114114

115115
$("#coastlineSettingsDialog").dialog({
116-
title: "Coastline Advanced Settings",
116+
title: "Coastline Settings Editor",
117117
resizable: false,
118118
width: "auto",
119-
position: {my: "center", at: "center", of: "svg"}
119+
position: {my: "right top", at: "right-10 top+10", of: "svg"}
120120
});
121121
}
122122

@@ -337,4 +337,10 @@ function drawShapePreview(canvas: HTMLCanvasElement): void {
337337
}
338338
}
339339

340+
declare global {
341+
interface Window {
342+
CoastlineEditor: {open: () => void};
343+
}
344+
}
340345

346+
window.CoastlineEditor = {open};

0 commit comments

Comments
 (0)