mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Small change in SeriesColorPickerPopoverProps
This commit is contained in:
@@ -8,7 +8,7 @@ export interface SeriesColorPickerProps {
|
|||||||
yaxis?: number;
|
yaxis?: number;
|
||||||
optionalClass?: string;
|
optionalClass?: string;
|
||||||
onColorChange: (newColor: string) => void;
|
onColorChange: (newColor: string) => void;
|
||||||
onToggleAxis: () => void;
|
onToggleAxis?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SeriesColorPicker extends React.Component<SeriesColorPickerProps> {
|
export class SeriesColorPicker extends React.Component<SeriesColorPickerProps> {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export interface SeriesColorPickerPopoverProps {
|
|||||||
color: string;
|
color: string;
|
||||||
yaxis?: number;
|
yaxis?: number;
|
||||||
onColorChange: (color: string) => void;
|
onColorChange: (color: string) => void;
|
||||||
onToggleAxis: () => void;
|
onToggleAxis?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SeriesColorPickerPopover extends React.PureComponent<SeriesColorPickerPopoverProps, any> {
|
export class SeriesColorPickerPopover extends React.PureComponent<SeriesColorPickerPopoverProps, any> {
|
||||||
@@ -21,7 +21,7 @@ export class SeriesColorPickerPopover extends React.PureComponent<SeriesColorPic
|
|||||||
|
|
||||||
interface AxisSelectorProps {
|
interface AxisSelectorProps {
|
||||||
yaxis: number;
|
yaxis: number;
|
||||||
onToggleAxis: () => void;
|
onToggleAxis?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AxisSelectorState {
|
interface AxisSelectorState {
|
||||||
@@ -41,7 +41,10 @@ export class AxisSelector extends React.PureComponent<AxisSelectorProps, AxisSel
|
|||||||
this.setState({
|
this.setState({
|
||||||
yaxis: this.state.yaxis === 2 ? 1 : 2,
|
yaxis: this.state.yaxis === 2 ? 1 : 2,
|
||||||
});
|
});
|
||||||
this.props.onToggleAxis();
|
|
||||||
|
if (this.props.onToggleAxis) {
|
||||||
|
this.props.onToggleAxis();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Reference in New Issue
Block a user