Commit 3ce45e71 by Peter Holmberg

shortening callback functions

parent 736db86d
...@@ -65,16 +65,16 @@ export default class MappingRow extends PureComponent<Props, State> { ...@@ -65,16 +65,16 @@ export default class MappingRow extends PureComponent<Props, State> {
label="From" label="From"
labelWidth={4} labelWidth={4}
inputWidth={8} inputWidth={8}
onChange={(event: ChangeEvent<HTMLInputElement>) => this.onMappingFromChange(event)} onBlur={this.updateMapping}
onBlur={() => this.updateMapping()} onChange={this.onMappingFromChange}
value={from} value={from}
/> />
<FormField <FormField
label="To" label="To"
labelWidth={4} labelWidth={4}
inputWidth={8} inputWidth={8}
onBlur={() => this.updateMapping} onBlur={this.updateMapping}
onChange={(event: ChangeEvent<HTMLInputElement>) => this.onMappingToChange(event)} onChange={this.onMappingToChange}
value={to} value={to}
/> />
<div className="gf-form gf-form--grow"> <div className="gf-form gf-form--grow">
...@@ -95,8 +95,8 @@ export default class MappingRow extends PureComponent<Props, State> { ...@@ -95,8 +95,8 @@ export default class MappingRow extends PureComponent<Props, State> {
<FormField <FormField
label="Value" label="Value"
labelWidth={4} labelWidth={4}
onBlur={() => this.updateMapping} onBlur={this.updateMapping}
onChange={(event: ChangeEvent<HTMLInputElement>) => this.onMappingValueChange(event)} onChange={this.onMappingValueChange}
value={value} value={value}
inputWidth={8} inputWidth={8}
/> />
......
...@@ -21,8 +21,8 @@ export default class GaugeOptionsEditor extends PureComponent<PanelOptionsProps< ...@@ -21,8 +21,8 @@ export default class GaugeOptionsEditor extends PureComponent<PanelOptionsProps<
return ( return (
<PanelOptionsGroup title="Gauge"> <PanelOptionsGroup title="Gauge">
<FormField label="Min value" labelWidth={8} onChange={event => this.onMinValueChange(event)} value={minValue} /> <FormField label="Min value" labelWidth={8} onChange={this.onMinValueChange} value={minValue} />
<FormField label="Max value" labelWidth={8} onChange={event => this.onMaxValueChange(event)} value={maxValue} /> <FormField label="Max value" labelWidth={8} onChange={this.onMaxValueChange} value={maxValue} />
<Switch <Switch
label="Show labels" label="Show labels"
labelClass="width-8" labelClass="width-8"
......
...@@ -56,22 +56,12 @@ export default class ValueOptions extends PureComponent<PanelOptionsProps<GaugeO ...@@ -56,22 +56,12 @@ export default class ValueOptions extends PureComponent<PanelOptionsProps<GaugeO
label="Decimals" label="Decimals"
labelWidth={labelWidth} labelWidth={labelWidth}
placeholder="auto" placeholder="auto"
onChange={event => this.onDecimalChange(event)} onChange={this.onDecimalChange}
value={decimals || ''} value={decimals || ''}
type="number" type="number"
/> />
<FormField <FormField label="Prefix" labelWidth={labelWidth} onChange={this.onPrefixChange} value={prefix || ''} />
label="Prefix" <FormField label="Suffix" labelWidth={labelWidth} onChange={this.onSuffixChange} value={suffix || ''} />
labelWidth={labelWidth}
onChange={event => this.onPrefixChange(event)}
value={prefix || ''}
/>
<FormField
label="Suffix"
labelWidth={labelWidth}
onChange={event => this.onSuffixChange(event)}
value={suffix || ''}
/>
</PanelOptionsGroup> </PanelOptionsGroup>
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment