From a52a5f1d4825305f46af03a01d1a035020be4df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Pluha=C5=99?= Date: Mon, 21 Nov 2022 16:30:04 +0100 Subject: [PATCH] [new #57] visual highlight of selected tasks --- src/components/PlanningTool.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/PlanningTool.jsx b/src/components/PlanningTool.jsx index 34cce62..e9dfaea 100644 --- a/src/components/PlanningTool.jsx +++ b/src/components/PlanningTool.jsx @@ -950,7 +950,7 @@ class PlanningTool extends Component { let backgroundColor = item.bgColor let color = item.color - if (itemContext.selected || item.selectedGroup) { + if (itemContext.selected) { color = item.selectedColor if (itemContext.dragging) { backgroundColor = item.draggingBgColor @@ -959,6 +959,8 @@ class PlanningTool extends Component { } } else if (item.highlight) { backgroundColor = item.highlightBgColor + }else if(item.selectedGroup){ + backgroundColor = '#c3073f' } if (itemContext.dimensions.width < 20) { @@ -983,9 +985,12 @@ class PlanningTool extends Component { if (event.ctrlKey) { item.selectedGroup = true } else { - item.selected = true this.removeHighlight() this.removeSelectedGroups() + + item.selected = true + item.selectedGroup = true + this.highlightChildren(item) this.highlightParents(item) this.showItemInfo(this.state.items.find(i => i.id === item.id)) @@ -1895,6 +1900,10 @@ PlanningTool.defaultProps = { { name: "task group", color: "blue" + }, + { + name: "group of selected tasks", + color: '#c3073f' } ] }