Browse Source

Fix type error - unused preSelect events

mj-deploy
Standa Lukeš 4 years ago
parent
commit
9092f6c137
  1. 4
      frontend/src/App.svelte
  2. 7
      frontend/src/Graph.svelte

4
frontend/src/App.svelte

@ -39,9 +39,7 @@
<div style="height: 100%"> <div style="height: 100%">
<Graph <Graph
tasks={t} tasks={t}
on:selectTask={(e) => { if (e.detail.type != "label") (location.hash = `#task/${e.detail.id}`)}} on:selectTask={(e) => { if (e.detail.type != "label") (location.hash = `#task/${e.detail.id}`)}}/>
on:preSelectTask={(e) => taskPanel.preSelect(e.detail) }
on:unPreSelectTask={(e) => taskPanel.unPreselect(e.detail)} />
</div> </div>
</TasksLoader> </TasksLoader>
{/if} {/if}

7
frontend/src/Graph.svelte

@ -54,15 +54,8 @@ import TaskDetailEditor from "./TaskDetailEditor.svelte";
function eventHandler(hovering: CustomEvent<boolean>) { function eventHandler(hovering: CustomEvent<boolean>) {
if (hovering.detail) { if (hovering.detail) {
hoveredTask = task; hoveredTask = task;
if (!selection.has(task) && !dragInProgress) {
selection.clear();
selection.add(task);
selection = selection;
}
eventDispatcher("preSelectTask", task);
} else { } else {
if (hoveredTask?.id == task.id) hoveredTask = null; if (hoveredTask?.id == task.id) hoveredTask = null;
eventDispatcher("unPreSelectTask", task);
} }
} }
return eventHandler; return eventHandler;