mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
changes from PR requests (#6880)
Signed-off-by: Jaga Santagostino <jagasantagostino@gmail.com>
This commit is contained in:
parent
4d6f9b75e2
commit
350f25eed3
|
@ -23,12 +23,12 @@ export class Legend extends PureComponent<LegendProps, LegendState> {
|
|||
this.setState({ selectedIndexes: [] });
|
||||
}
|
||||
}
|
||||
handleSeriesSelect = (index: number) => (ev: any) => {
|
||||
handleSeriesSelect = (index: number) => (ev: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
||||
// TODO: add proper event type
|
||||
const { selectedIndexes } = this.state;
|
||||
|
||||
let selected = [index];
|
||||
if (ev.ctrlKey) {
|
||||
if (ev.ctrlKey || ev.metaKey) {
|
||||
const { chartData } = this.props;
|
||||
if (selectedIndexes.includes(index)) {
|
||||
selected = selectedIndexes.filter(idx => idx !== index);
|
||||
|
@ -68,7 +68,7 @@ export class Legend extends PureComponent<LegendProps, LegendState> {
|
|||
))}
|
||||
{chartData.length > 1 && (
|
||||
<div className="pl-1 mt-1 text-muted" style={{ fontSize: 13 }}>
|
||||
Click: select series, CTRL + click: toggle multiple series
|
||||
Click: select series, {navigator.platform.includes('Mac') ? 'CMD' : 'CTRL'} + click: toggle multiple series
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue