mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-11 21:08:36 +03:00
Working onSelect with respect to caret toggle; onSelect doesnt fire off when caret is selected
This commit is contained in:
@@ -27,6 +27,13 @@ class Card extends React.Component {
|
||||
return makeNiceDate(datetime)
|
||||
}
|
||||
|
||||
handleCardSelect (e) {
|
||||
if (!e.target.className.includes('arrow-down')) {
|
||||
const selectedEventFormat = this.props.idx > 0 ? [this.props.event] : this.props.event
|
||||
this.props.onSelect(selectedEventFormat, this.props.idx)
|
||||
}
|
||||
}
|
||||
|
||||
renderSummary () {
|
||||
return (
|
||||
<CardSummary
|
||||
@@ -135,21 +142,12 @@ class Card extends React.Component {
|
||||
|
||||
render () {
|
||||
const { isSelected, idx } = this.props
|
||||
console.info(this.props)
|
||||
return (
|
||||
<li
|
||||
className={`event-card ${isSelected ? 'selected' : ''}`}
|
||||
id={`event-card-${idx}`}
|
||||
ref={this.props.innerRef}
|
||||
onClick={() => {
|
||||
console.info('getting clicked')
|
||||
if (!this.state.isOpen) {
|
||||
const selectedEventFormat = idx > 0 ? [this.props.event] : this.props.event
|
||||
this.props.onSelect(selectedEventFormat, idx)
|
||||
} else {
|
||||
console.info('NOT OPEN')
|
||||
}
|
||||
}}
|
||||
onClick={(e) => this.handleCardSelect(e)}
|
||||
>
|
||||
{this.renderMain()}
|
||||
{this.state.isOpen ? this.renderExtra() : null}
|
||||
|
||||
@@ -83,7 +83,6 @@ class Dashboard extends React.Component {
|
||||
}
|
||||
|
||||
handleSelect (selected, axis) {
|
||||
console.info(selected)
|
||||
const matchedEvents = []
|
||||
const TIMELINE_AXIS = 0
|
||||
if (axis === TIMELINE_AXIS) {
|
||||
|
||||
Reference in New Issue
Block a user