Convert add_game.js to TypeScript (issue #17)
- Add ts/utils.ts: fully-typed port of utils.js (onSwap, toISOUTCString, syncSelectInputUntilChanged, conditionalElementHandler, disableElementsWhen*, getValueFromProperty). Uses document.querySelector throughout; fixes removeEventListener bug (was passing function reference instead of named listener); uses boolean disabled property instead of string "disabled"/"" - Add ts/add_game.ts: TypeScript conversion of add_game.js, imports syncSelectInputUntilChanged from ts/utils.ts (resolves to dist/utils.js at runtime) - Update add_game view to serve compiled dist/add_game.js Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { syncSelectInputUntilChanged } from "./utils.js";
|
||||
|
||||
const syncData = [
|
||||
{
|
||||
source: "#id_name",
|
||||
source_value: "value",
|
||||
target: "#id_sort_name",
|
||||
target_value: "value",
|
||||
},
|
||||
];
|
||||
|
||||
syncSelectInputUntilChanged(syncData, "form");
|
||||
Reference in New Issue
Block a user