Browse Source

Use points from tasks.json

removes annoying flashing of tooltip (and annoying network requests)

fix #38
mj-deploy
Standa Lukeš 4 years ago
parent
commit
222e4f8e4b
  1. 13
      frontend/src/Graph.svelte

13
frontend/src/Graph.svelte

@ -202,6 +202,8 @@ import TaskDetailEditor from "./TaskDetailEditor.svelte";
tooltipBoxHeight = bbox.height + 5 + 5;
}
$: {
tooltipMaxPoints = null;
tooltipCurrPoints = null;
if (hoveredTask != null) {
const status = $taskStatuses.get(hoveredTask.id);
if (status) {
@ -209,18 +211,9 @@ import TaskDetailEditor from "./TaskDetailEditor.svelte";
tooltipCurrPoints = status.points;
}
else if (hoveredTask.type == 'open-data') {
const id = hoveredTask.id;
grabAssignment(hoveredTask.taskReference).then(e => {
if (hoveredTask?.id == id) {
tooltipMaxPoints = e.points
resizeTooltipBox()
}
})
tooltipMaxPoints = hoveredTask.points
}
resizeTooltipBox();
} else {
tooltipMaxPoints = null;
tooltipCurrPoints = null;
}
};
</script>