mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-25 16:31:37 +02:00
Prep state and props for dragging
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
8948c7419c
commit
c97bbe11a9
@ -50,6 +50,13 @@ interface IState {
|
||||
// Any other call we're displaying: only if the user is on two calls and not viewing either of the rooms
|
||||
// they belong to
|
||||
secondaryCall: MatrixCall;
|
||||
|
||||
// Position of the CallPreview
|
||||
translationX: number;
|
||||
translationY: number;
|
||||
|
||||
// True if the CallPreview is being dragged
|
||||
moving: boolean;
|
||||
}
|
||||
|
||||
// Splits a list of calls into one 'primary' one and a list
|
||||
@ -106,9 +113,17 @@ export default class CallPreview extends React.Component<IProps, IState> {
|
||||
roomId,
|
||||
primaryCall: primaryCall,
|
||||
secondaryCall: secondaryCalls[0],
|
||||
translationX: 0,
|
||||
translationY: 0,
|
||||
moving: false,
|
||||
};
|
||||
}
|
||||
|
||||
private initX = 0;
|
||||
private initY = 0;
|
||||
private lastX = 0;
|
||||
private lastY = 0;
|
||||
|
||||
public componentDidMount() {
|
||||
this.roomStoreToken = RoomViewStore.addListener(this.onRoomViewStoreUpdate);
|
||||
this.dispatcherRef = dis.register(this.onAction);
|
||||
|
Loading…
x
Reference in New Issue
Block a user