diff --git a/PlotLine/Views/PlotLineWorkspace/Manage.cshtml b/PlotLine/Views/PlotLineWorkspace/Manage.cshtml
index dce1d5f0..bab7c3c7 100644
--- a/PlotLine/Views/PlotLineWorkspace/Manage.cshtml
+++ b/PlotLine/Views/PlotLineWorkspace/Manage.cshtml
@@ -33,7 +33,7 @@
@if (threads[line.PlotLineID].Any())
{
-
+
@foreach (var thread in threads[line.PlotLineID])
{
-
diff --git a/PlotLine/wwwroot/js/plot-line-manage.js b/PlotLine/wwwroot/js/plot-line-manage.js
index 7e083513..d4763b74 100644
--- a/PlotLine/wwwroot/js/plot-line-manage.js
+++ b/PlotLine/wwwroot/js/plot-line-manage.js
@@ -7,18 +7,22 @@
const editUrl = actions.querySelector("[data-planning-edit]").href;
const addThreadUrl = actions.querySelector("[data-planning-add-thread]").href;
- summary.addEventListener("click", () => {
+ const selectLine = () => {
editLine.href = editUrl;
editLine.hidden = false;
addThread.href = addThreadUrl;
- });
+ };
+ summary.addEventListener("click", selectLine);
summary.addEventListener("dblclick", () => window.location.assign(editUrl));
- });
- document.querySelectorAll("[data-planning-thread]").forEach(row => {
- const editLink = row.querySelector("a");
- row.addEventListener("dblclick", event => {
- if (!event.target.closest("a")) window.location.assign(editLink.href);
+ const threadList = summary.parentElement.querySelector(":scope > [data-planning-threads]");
+ threadList?.querySelectorAll(":scope > [data-planning-thread]").forEach(row => {
+ const editLink = row.querySelector("a");
+ row.addEventListener("click", selectLine);
+ row.addEventListener("focusin", selectLine);
+ row.addEventListener("dblclick", event => {
+ if (!event.target.closest("a")) window.location.assign(editLink.href);
+ });
});
});
})();