Skip to content

Commit

Permalink
#1872 add clickHandler to canvas navigation label
Browse files Browse the repository at this point in the history
  • Loading branch information
glefi committed Feb 20, 2019
1 parent c73c5a4 commit 394263f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/WindowSideBarCanvasPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class WindowSideBarCanvasPanel extends Component {
canvasesIdAndLabel.map((canvas, canvasIndex) => {
const validationCanvas = new ValidationCanvas(canvases[canvasIndex]);
const isValid = validationCanvas.hasValidDimensions;
const onClick = () => { setCanvas(windowId, canvasIndex); }; // eslint-disable-line require-jsdoc, max-len

return (
<ListItem
key={canvas.id}
Expand All @@ -46,7 +48,7 @@ class WindowSideBarCanvasPanel extends Component {
className={classNames(classes.clickable)}
isValid={isValid}
imageUrl={validationCanvas.thumbnail(config.canvasNavigation.height)}
onClick={() => { setCanvas(windowId, canvasIndex); }}
onClick={onClick}
style={{
cursor: 'pointer',
height: config.canvasNavigation.height,
Expand All @@ -55,7 +57,7 @@ class WindowSideBarCanvasPanel extends Component {
/>
<Typography
className={classNames(classes.clickable, classes.label)}
onClick={() => { setCanvas(windowId, canvasIndex); }}
onClick={onClick}
variant="body2"
>
{canvas.label}
Expand Down

0 comments on commit 394263f

Please sign in to comment.