Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
update copyright and rename handlers
Browse files Browse the repository at this point in the history
Signed-off-by: Kerry Archibald <kerrya@element.io>
  • Loading branch information
Kerry Archibald committed Dec 7, 2021
1 parent 88189e5 commit 815f536
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/components/views/elements/AccessibleTooltipButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ export default class AccessibleTooltipButton extends React.PureComponent<IToolti
}
}

onMouseOver = () => {
showTooltip = () => {
if (this.props.forceHide) return;
this.setState({
hover: true,
});
};

onMouseLeave = () => {
hideTooltip = () => {
this.setState({
hover: false,
});
Expand All @@ -78,10 +78,10 @@ export default class AccessibleTooltipButton extends React.PureComponent<IToolti
return (
<AccessibleButton
{...props}
onMouseOver={this.onMouseOver}
onMouseLeave={this.onMouseLeave}
onFocus={this.onMouseOver}
onBlur={this.onMouseLeave}
showTooltip={this.showTooltip}
hideTooltip={this.hideTooltip}
onFocus={this.showTooltip}
onBlur={this.hideTooltip}
aria-label={title}
>
{ children }
Expand Down
12 changes: 6 additions & 6 deletions src/components/views/elements/ActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ export default class ActionButton extends React.Component<IProps, IState> {
};

private onMouseEnter = (): void => {
this.onShowTooltip();
this.showTooltip();
if (this.props.mouseOverAction) {
dis.dispatch({ action: this.props.mouseOverAction });
}
};

private onShowTooltip = (): void => {
private showTooltip = (): void => {
if (this.props.tooltip) this.setState({ showTooltip: true });
};

private onHideTooltip = (): void => {
private hideTooltip = (): void => {
this.setState({ showTooltip: false });
};

Expand All @@ -92,9 +92,9 @@ export default class ActionButton extends React.Component<IProps, IState> {
className={classNames.join(" ")}
onClick={this.onClick}
onMouseEnter={this.onMouseEnter}
onMouseLeave={this.onHideTooltip}
onFocus={this.onShowTooltip}
onBlur={this.onHideTooltip}
onMouseLeave={this.hideTooltip}
onFocus={this.showTooltip}
onBlur={this.hideTooltip}
aria-label={this.props.label}
>
{ icon }
Expand Down
3 changes: 1 addition & 2 deletions src/components/views/elements/TooltipTarget.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright 2017 New Vector Ltd.
Copyright 2019 The Matrix.org Foundation C.I.C.
Copyright 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 815f536

Please sign in to comment.