mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
support iframes for RTS urls
This commit is contained in:
parent
64a67583e0
commit
1e1a43c78f
@ -43,16 +43,16 @@ module.exports = React.createClass({
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
if (this.props.teamToken && this.props.teamServerUrl) {
|
||||
return;
|
||||
}
|
||||
|
||||
// we use request() to inline the homepage into the react component
|
||||
// so that it can inherit CSS and theming easily rather than mess around
|
||||
// with iframes and trying to synchronise document.stylesheets.
|
||||
|
||||
let src = this.props.homePageUrl || '/home.html';
|
||||
|
||||
if (this.props.teamToken && this.props.teamServerUrl) {
|
||||
src = `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`;
|
||||
}
|
||||
|
||||
request(
|
||||
{ method: "GET", url: src },
|
||||
(err, response, body) => {
|
||||
@ -71,11 +71,21 @@ module.exports = React.createClass({
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<GeminiScrollbar autoshow={true} className="mx_HomePage">
|
||||
<div className="mx_HomePage_body" dangerouslySetInnerHTML={{ __html: this.state.page }}>
|
||||
if (this.props.teamToken && this.props.teamServerUrl) {
|
||||
src = `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`;
|
||||
return (
|
||||
<div className="mx_HomePage">
|
||||
<iframe src={ src } />
|
||||
</div>
|
||||
</GeminiScrollbar>
|
||||
);
|
||||
);
|
||||
}
|
||||
else {
|
||||
return (
|
||||
<GeminiScrollbar autoshow={true} className="mx_HomePage">
|
||||
<div className="mx_HomePage_body" dangerouslySetInnerHTML={{ __html: this.state.page }}>
|
||||
</div>
|
||||
</GeminiScrollbar>
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user