diff --git a/res/img/button-refresh.svg b/res/img/button-refresh.svg new file mode 100644 index 0000000000..b4990a2147 --- /dev/null +++ b/res/img/button-refresh.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 018b6cb342..5f3ed6eba1 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -55,6 +55,7 @@ export default class AppTile extends React.Component { this._grantWidgetPermission = this._grantWidgetPermission.bind(this); this._revokeWidgetPermission = this._revokeWidgetPermission.bind(this); this._onPopoutWidgetClick = this._onPopoutWidgetClick.bind(this); + this._onReloadWidgetClick = this._onReloadWidgetClick.bind(this); } /** @@ -533,6 +534,11 @@ export default class AppTile extends React.Component { { target: '_blank', href: this._getSafeUrl(), rel: 'noopener noreferrer'}).click(); } + _onReloadWidgetClick(e) { + // Reload iframe in this way to avoid cross-origin restrictions + this.refs.appFrame.src = this.refs.appFrame.src; + } + render() { let appTileBody; @@ -620,6 +626,7 @@ export default class AppTile extends React.Component { const showPictureSnapshotButton = this._hasCapability('m.capability.screenshot') && this.props.show; const showPictureSnapshotIcon = 'img/camera_green.svg'; const popoutWidgetIcon = 'img/button-new-window.svg'; + const reloadWidgetIcon = 'img/button-refresh.svg'; const windowStateIcon = (this.props.show ? 'img/minimize.svg' : 'img/maximize.svg'); return ( @@ -638,6 +645,16 @@ export default class AppTile extends React.Component { { this.props.showTitle && this._getTileTitle() } + { /* Reload widget */ } + { this.props.showReload && } + { /* Popout widget */ } { this.props.showPopout &&