Select the parent plot line from Manage thread rows
This commit is contained in:
parent
126888e5cb
commit
f8914c364c
@ -33,7 +33,7 @@
|
||||
</div>
|
||||
@if (threads[line.PlotLineID].Any())
|
||||
{
|
||||
<ul class="list-unstyled ps-3 mb-2">
|
||||
<ul class="list-unstyled ps-3 mb-2" data-planning-threads>
|
||||
@foreach (var thread in threads[line.PlotLineID])
|
||||
{
|
||||
<li data-planning-thread>
|
||||
|
||||
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user