App tile events

This commit is contained in:
Richard Lewis 2017-05-22 18:00:17 +01:00
parent e8837d28ef
commit b111579aed
2 changed files with 26 additions and 7 deletions

View File

@ -33,19 +33,38 @@ export default React.createClass({
};
},
_onEditClick: function() {
console.log("Edit widget %s", this.props.id);
},
_onDeleteClick: function() {
console.log("Delete widget %s", this.props.id);
},
render: function() {
return (
<div className="mx_AppTile" id={this.props.id}>
<div className="mx_AppTileMenuBar">
{this.props.name}
<span className="mx_AppTileMenuBarWidgets">
<img src="img/edit.svg" className="mx_filterFlipColor mx_AppTileMenuBarWidgetPadding" width="8" height="8" alt="Edit"/>
<img src="img/cancel.svg" className="mx_filterFlipColor" width="8" height="8" alt="Cancel"/>
{/* <span className="mx_CloseAppWidget">x</span> */}
{/* Edit widget */}
<img
src="img/edit.svg"
className="mx_filterFlipColor mx_AppTileMenuBarWidget mx_AppTileMenuBarWidgetPadding"
width="8" height="8" alt="Edit"
onClick={this._onEditClick}
/>
{/* Delete widget */}
<img src="img/cancel.svg"
className="mx_filterFlipColor mx_AppTileMenuBarWidget"
width="8" height="8" alt="Cancel"
onClick={this._onDeleteClick}
/>
</span>
</div>
<div className="mx_AppTileBody">
<iframe sandbox seamless="seamless" src={this.props.url}></iframe>
<iframe sandbox="sandbox" seamless="seamless" src={this.props.url}></iframe>
</div>
</div>
);

View File

@ -40,9 +40,9 @@ module.exports = React.createClass({
getInitialState: function() {
return {
apps: [{
id: "googleApp",
url: "http://matrix.org/grafana/dashboard/db/golang-metrics?panelId=2&fullscreen&edit&var-bucket_size=1m&var-job=riot-bot&var-handler=All&from=1495188444653&to=1495210044654",
name: "Google",
id: "riot-bot",
url: "https://matrix.org/_matrix/media/v1/thumbnail/matrix.org/LvHiqFMHWxAjFUMVCvaPbRYs?width=150&height=150",
name: "Riot-bot",
}],
};
},