mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 10:15:43 +03:00
Ensure iframe gets maximize/minimize events
This commit is contained in:
parent
6ccce7142c
commit
987ee702d3
2 changed files with 18 additions and 8 deletions
|
@ -64,10 +64,14 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
|
||||||
this.onAccountDetailsRequest();
|
this.onAccountDetailsRequest();
|
||||||
break;
|
break;
|
||||||
case PostmessageAction.Maximize:
|
case PostmessageAction.Maximize:
|
||||||
this.maximizeDialog();
|
this.setState({
|
||||||
|
minimized: false,
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case PostmessageAction.Minimize:
|
case PostmessageAction.Minimize:
|
||||||
this.minimizeDialog();
|
this.setState({
|
||||||
|
minimized: true,
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case PostmessageAction.SetupComplete:
|
case PostmessageAction.SetupComplete:
|
||||||
// Set as completed but let the user close the modal themselves
|
// Set as completed but let the user close the modal themselves
|
||||||
|
@ -82,17 +86,23 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
|
||||||
}
|
}
|
||||||
|
|
||||||
private maximizeDialog = () => {
|
private maximizeDialog = () => {
|
||||||
if (this.state.minimized) {
|
this.setState({
|
||||||
this.setState({
|
minimized: false,
|
||||||
minimized: false,
|
});
|
||||||
});
|
// Send this action to the iframe so it can act accordingly
|
||||||
}
|
this.sendMessage({
|
||||||
|
action: PostmessageAction.Maximize,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private minimizeDialog = () => {
|
private minimizeDialog = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
minimized: true,
|
minimized: true,
|
||||||
});
|
});
|
||||||
|
// Send this action to the iframe so it can act accordingly
|
||||||
|
this.sendMessage({
|
||||||
|
action: PostmessageAction.Minimize,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private closeDialog = async () => {
|
private closeDialog = async () => {
|
||||||
|
|
|
@ -38,7 +38,7 @@ export interface IPostmessageRequestData {
|
||||||
|
|
||||||
export interface IPostmessageResponseData {
|
export interface IPostmessageResponseData {
|
||||||
action: PostmessageAction;
|
action: PostmessageAction;
|
||||||
account: IAccountData;
|
account?: IAccountData;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IPostmessage {
|
export interface IPostmessage {
|
||||||
|
|
Loading…
Reference in a new issue