4f535be270
- 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>
13 lines
245 B
TypeScript
13 lines
245 B
TypeScript
import { syncSelectInputUntilChanged } from "./utils.js";
|
|
|
|
const syncData = [
|
|
{
|
|
source: "#id_name",
|
|
source_value: "value",
|
|
target: "#id_sort_name",
|
|
target_value: "value",
|
|
},
|
|
];
|
|
|
|
syncSelectInputUntilChanged(syncData, "form");
|