mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-25 00:11:43 +02:00
Listen for mousemove on document scale
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
241e626e96
commit
53b8fd3072
@ -126,12 +126,14 @@ export default class CallPreview extends React.Component<IProps, IState> {
|
||||
|
||||
public componentDidMount() {
|
||||
this.roomStoreToken = RoomViewStore.addListener(this.onRoomViewStoreUpdate);
|
||||
document.addEventListener("mousemove", this.onMoving);
|
||||
this.dispatcherRef = dis.register(this.onAction);
|
||||
MatrixClientPeg.get().on(CallEvent.RemoteHoldUnhold, this.onCallRemoteHold);
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
MatrixClientPeg.get().removeListener(CallEvent.RemoteHoldUnhold, this.onCallRemoteHold);
|
||||
document.removeEventListener("mousemove", this.onMoving);
|
||||
if (this.roomStoreToken) {
|
||||
this.roomStoreToken.remove();
|
||||
}
|
||||
@ -191,7 +193,7 @@ export default class CallPreview extends React.Component<IProps, IState> {
|
||||
this.initY = event.pageY - this.lastY;
|
||||
}
|
||||
|
||||
private onMoving = (event: React.MouseEvent) => {
|
||||
private onMoving = (event: React.MouseEvent | MouseEvent) => {
|
||||
if (!this.state.moving) return;
|
||||
|
||||
this.lastX = event.pageX - this.initX;
|
||||
|
Loading…
x
Reference in New Issue
Block a user