You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Listen for mouseup on the document
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -127,6 +127,7 @@ export default class CallPreview extends React.Component<IProps, IState> {
|
|||||||
public componentDidMount() {
|
public componentDidMount() {
|
||||||
this.roomStoreToken = RoomViewStore.addListener(this.onRoomViewStoreUpdate);
|
this.roomStoreToken = RoomViewStore.addListener(this.onRoomViewStoreUpdate);
|
||||||
document.addEventListener("mousemove", this.onMoving);
|
document.addEventListener("mousemove", this.onMoving);
|
||||||
|
document.addEventListener("mouseup", this.onEndMoving);
|
||||||
this.dispatcherRef = dis.register(this.onAction);
|
this.dispatcherRef = dis.register(this.onAction);
|
||||||
MatrixClientPeg.get().on(CallEvent.RemoteHoldUnhold, this.onCallRemoteHold);
|
MatrixClientPeg.get().on(CallEvent.RemoteHoldUnhold, this.onCallRemoteHold);
|
||||||
}
|
}
|
||||||
@@ -134,6 +135,7 @@ export default class CallPreview extends React.Component<IProps, IState> {
|
|||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
MatrixClientPeg.get().removeListener(CallEvent.RemoteHoldUnhold, this.onCallRemoteHold);
|
MatrixClientPeg.get().removeListener(CallEvent.RemoteHoldUnhold, this.onCallRemoteHold);
|
||||||
document.removeEventListener("mousemove", this.onMoving);
|
document.removeEventListener("mousemove", this.onMoving);
|
||||||
|
document.removeEventListener("mouseup", this.onEndMoving);
|
||||||
if (this.roomStoreToken) {
|
if (this.roomStoreToken) {
|
||||||
this.roomStoreToken.remove();
|
this.roomStoreToken.remove();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -626,7 +626,6 @@ export default class CallView extends React.Component<IProps, IState> {
|
|||||||
<div
|
<div
|
||||||
className="mx_CallView_header"
|
className="mx_CallView_header"
|
||||||
onMouseDown={this.props.dragCallbacks?.onStartMoving}
|
onMouseDown={this.props.dragCallbacks?.onStartMoving}
|
||||||
onMouseUp={this.props.dragCallbacks?.onEndMoving}
|
|
||||||
>
|
>
|
||||||
<AccessibleButton onClick={this.onRoomAvatarClick}>
|
<AccessibleButton onClick={this.onRoomAvatarClick}>
|
||||||
<RoomAvatar room={callRoom} height={32} width={32} />
|
<RoomAvatar room={callRoom} height={32} width={32} />
|
||||||
|
|||||||
Reference in New Issue
Block a user