Small change in SeriesColorPickerPopoverProps

This commit is contained in:
Hugo Häggmark 2019-01-10 13:38:55 +01:00
parent d376fae393
commit 37dae043d7
2 changed files with 7 additions and 4 deletions

View File

@ -8,7 +8,7 @@ export interface SeriesColorPickerProps {
yaxis?: number;
optionalClass?: string;
onColorChange: (newColor: string) => void;
onToggleAxis: () => void;
onToggleAxis?: () => void;
}
export class SeriesColorPicker extends React.Component<SeriesColorPickerProps> {

View File

@ -5,7 +5,7 @@ export interface SeriesColorPickerPopoverProps {
color: string;
yaxis?: number;
onColorChange: (color: string) => void;
onToggleAxis: () => void;
onToggleAxis?: () => void;
}
export class SeriesColorPickerPopover extends React.PureComponent<SeriesColorPickerPopoverProps, any> {
@ -21,7 +21,7 @@ export class SeriesColorPickerPopover extends React.PureComponent<SeriesColorPic
interface AxisSelectorProps {
yaxis: number;
onToggleAxis: () => void;
onToggleAxis?: () => void;
}
interface AxisSelectorState {
@ -41,7 +41,10 @@ export class AxisSelector extends React.PureComponent<AxisSelectorProps, AxisSel
this.setState({
yaxis: this.state.yaxis === 2 ? 1 : 2,
});
this.props.onToggleAxis();
if (this.props.onToggleAxis) {
this.props.onToggleAxis();
}
}
render() {