improve lipstick and support scalar logout

This commit is contained in:
Matthew Hodgson 2016-09-18 02:57:15 +01:00
parent 4720da3f8e
commit af230b5fa8
2 changed files with 19 additions and 14 deletions

View file

@ -19,6 +19,7 @@ limitations under the License.
var React = require('react');
var sdk = require('matrix-react-sdk');
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
var dis = require('matrix-react-sdk/lib/dispatcher');
module.exports = React.createClass({
displayName: 'IntegrationsManager',
@ -31,11 +32,13 @@ module.exports = React.createClass({
// XXX: keyboard shortcuts for managing dialogs should be done by the modal
// dialog base class somehow, surely...
componentDidMount: function() {
this.dispatcherRef = dis.register(this.onAction);
document.addEventListener("keydown", this.onKeyDown);
},
componentWillUnmount: function() {
document.removeEventListener("keydown", this.onKeyDown);
dis.unregister(this.dispatcherRef);
},
onKeyDown: function(ev) {
@ -46,11 +49,15 @@ module.exports = React.createClass({
}
},
onAction: function(payload) {
if (payload.action === 'close_scalar') {
this.props.onFinished();
}
},
render: function() {
return (
<div className="mx_IntegrationsManager">
<iframe src={ this.props.src }></iframe>
</div>
<iframe src={ this.props.src }></iframe>
);
}
});