diff --git a/src/components/Card.jsx b/src/components/Card.jsx index fbce6eb..8fc9f56 100644 --- a/src/components/Card.jsx +++ b/src/components/Card.jsx @@ -172,7 +172,7 @@ class Card extends React.Component { className={`event-card ${isSelected ? 'selected' : ''}`} id={`event-card-${idx}`} ref={this.props.innerRef} - onClick={this.props.onClick} + onClick={this.props.onSelect} > {this.renderMain()} {this.state.isOpen ? this.renderExtra() : null} diff --git a/src/components/CardStack.jsx b/src/components/CardStack.jsx index a3dc5a0..9893190 100644 --- a/src/components/CardStack.jsx +++ b/src/components/CardStack.jsx @@ -72,9 +72,8 @@ class CardStack extends React.Component { getCategoryLabel={this.props.getCategoryLabel} onViewSource={this.props.onViewSource} onHighlight={this.props.onHighlight} - onSelect={this.props.onSelect} + onSelect={() => this.props.onSelect(idx)} features={this.props.features} - onClick={() => this.props.onSelectNarrativeStep(idx)} />) }) } diff --git a/src/components/Layout.js b/src/components/Layout.js index de50765..da80426 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -125,6 +125,7 @@ class Dashboard extends React.Component { setNarrative (narrative) { // only handleSelect if narrative is not null + console.log(narrative) if (narrative) { this.handleSelect([ narrative.steps[0] ]) } @@ -259,10 +260,9 @@ class Dashboard extends React.Component { this.handleSelect(ev, 1), onSelectNarrative: this.setNarrative, getCategoryColor: this.getCategoryColor, - onSelectNarrativeStep: this.selectNarrativeStep + onSelect: (app.narrative ? this.selectNarrativeStep : (ev => this.handleSelect(ev, 1))) }} /> actions.updateSelected([])} getNarrativeLinks={event => this.getNarrativeLinks(event)} getCategoryColor={this.getCategoryColor} - onSelectNarrativeStep={this.selectNarrativeStep} /> 0} diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 6e1ae04..b40baa5 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -182,7 +182,6 @@ class Map extends React.Component { projectPoint={this.projectPoint} narrative={this.props.app.narrative} styles={this.props.ui.narratives} - onSelect={this.props.methods.onSelect} onSelectNarrative={this.props.methods.onSelectNarrative} features={this.props.features} /> @@ -214,7 +213,6 @@ class Map extends React.Component { selected={this.props.app.selected} narrative={this.props.app.narrative} onSelect={this.props.methods.onSelect} - onSelectNarrative={this.props.methods.onSelectNarrativeStep} getCategoryColor={this.props.methods.getCategoryColor} eventRadius={this.props.ui.eventRadius} /> diff --git a/src/components/presentational/Map/Events.jsx b/src/components/presentational/Map/Events.jsx index 3dafbc8..d21efe3 100644 --- a/src/components/presentational/Map/Events.jsx +++ b/src/components/presentational/Map/Events.jsx @@ -13,8 +13,7 @@ function MapEvents ({ onSelect, svg, locations, - eventRadius, - onSelectNarrative + eventRadius }) { function getCoordinatesForPercent (radius, percent) { const x = radius * Math.cos(2 * Math.PI * percent) @@ -144,7 +143,7 @@ function MapEvents ({ onSelect(location.events) : () => { onSelectNarrative(narrativeIdx); onSelect(location.events) }} + onClick={(!narrative) ? () => onSelect(location.events) : () => { onSelect(narrativeIdx); onSelect(location.events) }} > {renderLocationSlicesByCategory(location)} {extraRender ? extraRender() : null}