grafik: close task dialog when clicking outside of it
This commit is contained in:
parent
6d6c3bf701
commit
8d8f569997
3 changed files with 8 additions and 1 deletions
|
@ -39,7 +39,8 @@
|
|||
<div style="height: 100%">
|
||||
<Graph
|
||||
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:closeTask={() => {location.hash = '#'}} />
|
||||
</div>
|
||||
</TasksLoader>
|
||||
{/if}
|
||||
|
|
|
@ -81,6 +81,10 @@ import TaskDetailEditor from "./TaskDetailEditor.svelte";
|
|||
d3.select(container).call(zoomer);
|
||||
}
|
||||
|
||||
function containerClickHandler(e: MouseEvent) {
|
||||
eventDispatcher("closeTask");
|
||||
}
|
||||
|
||||
function groupSelectionHandler(e: MouseEvent) {
|
||||
// not enabled?
|
||||
if (!selectionToolEnabled) return;
|
||||
|
@ -271,6 +275,7 @@ import TaskDetailEditor from "./TaskDetailEditor.svelte";
|
|||
bind:this={container}
|
||||
bind:clientHeight
|
||||
bind:clientWidth
|
||||
on:click={containerClickHandler}
|
||||
on:mousedown={groupSelectionHandler}
|
||||
on:contextmenu={(e) => {
|
||||
if (selectionToolEnabled) {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
}
|
||||
|
||||
function click(e: MouseEvent) {
|
||||
e.stopPropagation();
|
||||
eventDispatcher("click", e);
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue