Skip to content

Commit

Permalink
Merge pull request #161 from forensic-architecture/feature/multi-sele…
Browse files Browse the repository at this point in the history
…ct-events

Feature/multi select events
  • Loading branch information
ebefarooqui authored Sep 28, 2020
2 parents 5d78caa + 5bc3961 commit 077ad59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/components/Timeline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ class Timeline extends React.Component {
if (nextProps.dimensions.trackHeight !== this.props.dimensions.trackHeight) {
this.computeDims()
}

if (hash(nextProps.app.selected) !== hash(this.props.app.selected)) {
if (!!nextProps.app.selected && nextProps.app.selected.length > 0) {
this.onCenterTime(nextProps.app.selected[0].datetime)
}
}
}

addEventListeners () {
Expand Down
7 changes: 6 additions & 1 deletion src/components/presentational/Map/Events.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ function MapEvents ({
return [x, y]
}

function handleEventSelect (e, location) {
const events = e.shiftKey ? selected.concat(location.events) : location.events
onSelect(events)
}

function renderBorder () {
return (
<React.Fragment>
Expand Down Expand Up @@ -135,7 +140,7 @@ function MapEvents ({
<g
className={`location-event ${narrative ? 'no-hover' : ''}`}
transform={`translate(${x}, ${y})`}
onClick={() => onSelect(location.events)}
onClick={(e) => handleEventSelect(e, location)}
>
{renderLocationSlicesByCategory(location)}
{extraRender ? extraRender() : null}
Expand Down

0 comments on commit 077ad59

Please sign in to comment.