mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 21:38:35 +03:00
Merge pull request #161 from forensic-architecture/feature/multi-select-events
Feature/multi select events
This commit is contained in:
@@ -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 () {
|
||||
|
||||
@@ -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>
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user