Fix Texas Hold'em dealer page: script timing crash and seat overlap
main.js ran an IIFE immediately, but the layout renders @section Scripts inside <head> before <body> exists, so every getElementById() call hit null. Wrapped init in DOMContentLoaded, matching the rest of the codebase (e.g. ChessScripts/chessMain.js). Separately, the original seat cards packed a full data-entry form (name, toggles, 2 cards, 5 chip counters, $ override, custom fields) into each of up to 24 positions around a circle — at any screen size, adjacent seats overlapped badly. Replaced with compact seat "pucks" for the table view (name, cards, total, blind/dealer badges) plus a dedicated seat editor panel in the sidebar that opens for whichever seat is clicked. Verified via Playwright MCP: load with no console errors, drag-and-drop seat swap, and a 3-way side-pot resolution (short all-in capped correctly, remainder awarded to the next-best hand) end to end. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018CmAti1baCjidbJM2HeJfk
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
(function () {
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const state = HoldemState.load();
|
||||
|
||||
const hooks = {
|
||||
@@ -67,4 +67,4 @@
|
||||
document.getElementById("potWizardOverlay").addEventListener("click", e => {
|
||||
if (e.target.id === "potWizardOverlay") PotWizard.close();
|
||||
});
|
||||
})();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user