Skip to content

Commit

Permalink
Update log row hover background only if context is not open
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanahuckova committed Jun 29, 2020
1 parent b13a4e0 commit 144197c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions packages/grafana-ui/src/components/Logs/LogRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,23 @@ class UnThemedLogRow extends PureComponent<Props, State> {
};

/**
* We are using onMouse events to change background of Log Details Table to hover-state-background when
* hovered over Log Row and vice versa. This can't be done with css because we use 2 separate table rows without common parent element.
* We are using onMouse events to change background of Log Details Table to hover-state-background when hovered over Log
* Row and vice versa, when context is not open. This can't be done with css because we use 2 separate table rows without common parent element.
*/
addHoverBackground = () => {
this.setState({
hasHoverBackground: true,
});
if (!this.state.showContext) {
this.setState({
hasHoverBackground: true,
});
}
};

clearHoverBackground = () => {
this.setState({
hasHoverBackground: false,
});
if (!this.state.showContext) {
this.setState({
hasHoverBackground: false,
});
}
};

toggleDetails = () => {
Expand Down

0 comments on commit 144197c

Please sign in to comment.