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() { render: function() {
return ( return (
<div className="mx_AppTile" id={this.props.id}> <div className="mx_AppTile" id={this.props.id}>
<div className="mx_AppTileMenuBar"> <div className="mx_AppTileMenuBar">
{this.props.name} {this.props.name}
<span className="mx_AppTileMenuBarWidgets"> <span className="mx_AppTileMenuBarWidgets">
<img src="img/edit.svg" className="mx_filterFlipColor mx_AppTileMenuBarWidgetPadding" width="8" height="8" alt="Edit"/> {/* Edit widget */}
<img src="img/cancel.svg" className="mx_filterFlipColor" width="8" height="8" alt="Cancel"/> <img
{/* <span className="mx_CloseAppWidget">x</span> */} 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> </span>
</div> </div>
<div className="mx_AppTileBody"> <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>
</div> </div>
); );

View file

@ -40,9 +40,9 @@ module.exports = React.createClass({
getInitialState: function() { getInitialState: function() {
return { return {
apps: [{ apps: [{
id: "googleApp", id: "riot-bot",
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", url: "https://matrix.org/_matrix/media/v1/thumbnail/matrix.org/LvHiqFMHWxAjFUMVCvaPbRYs?width=150&height=150",
name: "Google", name: "Riot-bot",
}], }],
}; };
}, },