Commit 3ce45e71 by Peter Holmberg

shortening callback functions

parent 736db86d
......@@ -65,16 +65,16 @@ export default class MappingRow extends PureComponent<Props, State> {
label="From"
labelWidth={4}
inputWidth={8}
onChange={(event: ChangeEvent<HTMLInputElement>) => this.onMappingFromChange(event)}
onBlur={() => this.updateMapping()}
onBlur={this.updateMapping}
onChange={this.onMappingFromChange}
value={from}
/>
<FormField
label="To"
labelWidth={4}
inputWidth={8}
onBlur={() => this.updateMapping}
onChange={(event: ChangeEvent<HTMLInputElement>) => this.onMappingToChange(event)}
onBlur={this.updateMapping}
onChange={this.onMappingToChange}
value={to}
/>
<div className="gf-form gf-form--grow">
......@@ -95,8 +95,8 @@ export default class MappingRow extends PureComponent<Props, State> {
<FormField
label="Value"
labelWidth={4}
onBlur={() => this.updateMapping}
onChange={(event: ChangeEvent<HTMLInputElement>) => this.onMappingValueChange(event)}
onBlur={this.updateMapping}
onChange={this.onMappingValueChange}
value={value}
inputWidth={8}
/>
......
......@@ -21,8 +21,8 @@ export default class GaugeOptionsEditor extends PureComponent<PanelOptionsProps<
return (
<PanelOptionsGroup title="Gauge">
<FormField label="Min value" labelWidth={8} onChange={event => this.onMinValueChange(event)} value={minValue} />
<FormField label="Max value" labelWidth={8} onChange={event => this.onMaxValueChange(event)} value={maxValue} />
<FormField label="Min value" labelWidth={8} onChange={this.onMinValueChange} value={minValue} />
<FormField label="Max value" labelWidth={8} onChange={this.onMaxValueChange} value={maxValue} />
<Switch
label="Show labels"
labelClass="width-8"
......
......@@ -56,22 +56,12 @@ export default class ValueOptions extends PureComponent<PanelOptionsProps<GaugeO
label="Decimals"
labelWidth={labelWidth}
placeholder="auto"
onChange={event => this.onDecimalChange(event)}
onChange={this.onDecimalChange}
value={decimals || ''}
type="number"
/>
<FormField
label="Prefix"
labelWidth={labelWidth}
onChange={event => this.onPrefixChange(event)}
value={prefix || ''}
/>
<FormField
label="Suffix"
labelWidth={labelWidth}
onChange={event => this.onSuffixChange(event)}
value={suffix || ''}
/>
<FormField label="Prefix" labelWidth={labelWidth} onChange={this.onPrefixChange} value={prefix || ''} />
<FormField label="Suffix" labelWidth={labelWidth} onChange={this.onSuffixChange} value={suffix || ''} />
</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