diff --git a/pkg/web/assets/js/issue-list-dblclick.js b/pkg/web/assets/js/issue-list-dblclick.js new file mode 100644 index 0000000..e4b4a1c --- /dev/null +++ b/pkg/web/assets/js/issue-list-dblclick.js @@ -0,0 +1,19 @@ +/** + * Open edit-issue modal when double-clicking a row in the issue list (list view). + * Uses event delegation and preventDefault so double-click doesn't select text. + */ +(function () { + document.addEventListener("dblclick", function (e) { + var row = e.target.closest("tr[data-issue-id]"); + if (!row) return; + e.preventDefault(); + var id = row.getAttribute("data-issue-id"); + if (!id) return; + if (typeof htmx !== "undefined") { + htmx.ajax("GET", "/issues/" + id + "/edit", { + target: "#modal-container", + swap: "innerHTML", + }); + } + }); +})(); diff --git a/pkg/web/routes/dashboard.templ b/pkg/web/routes/dashboard.templ index fc09df2..4ad5c02 100644 --- a/pkg/web/routes/dashboard.templ +++ b/pkg/web/routes/dashboard.templ @@ -135,20 +135,13 @@ templ DashboardIssueRows(issues []*models.Issue, selectedID string) { }}