click on CallView preview to jump to call

This commit is contained in:
Matthew Hodgson 2015-11-08 12:14:10 +00:00
parent e289235e17
commit 36da1accca
3 changed files with 13 additions and 3 deletions

View file

@ -34,7 +34,7 @@ module.exports = React.createClass({
render: function(){ render: function(){
var VideoView = sdk.getComponent('molecules.voip.VideoView'); var VideoView = sdk.getComponent('molecules.voip.VideoView');
return ( return (
<VideoView ref="video"/> <VideoView ref="video" onClick={ this.props.onClick }/>
); );
} }
}); });

View file

@ -78,7 +78,7 @@ module.exports = React.createClass({
render: function() { render: function() {
var VideoFeed = sdk.getComponent('atoms.voip.VideoFeed'); var VideoFeed = sdk.getComponent('atoms.voip.VideoFeed');
return ( return (
<div className="mx_VideoView" ref={this.setContainer}> <div className="mx_VideoView" ref={this.setContainer} onClick={ this.props.onClick }>
<div className="mx_VideoView_remoteVideoFeed"> <div className="mx_VideoView_remoteVideoFeed">
<VideoFeed ref="remote"/> <VideoFeed ref="remote"/>
<audio ref="remoteAudio"/> <audio ref="remoteAudio"/>

View file

@ -71,6 +71,16 @@ module.exports = React.createClass({
}); });
}, },
onCallViewClick: function() {
var call = CallHandler.getAnyActiveCall();
if (call) {
dis.dispatch({
action: 'view_room',
room_id: call.roomId,
});
}
},
render: function() { render: function() {
var RoomList = sdk.getComponent('organisms.RoomList'); var RoomList = sdk.getComponent('organisms.RoomList');
var BottomLeftMenu = sdk.getComponent('molecules.BottomLeftMenu'); var BottomLeftMenu = sdk.getComponent('molecules.BottomLeftMenu');
@ -89,7 +99,7 @@ module.exports = React.createClass({
var callPreview; var callPreview;
if (this.state.showCallElement) { if (this.state.showCallElement) {
var CallView = sdk.getComponent('molecules.voip.CallView'); var CallView = sdk.getComponent('molecules.voip.CallView');
callPreview = <CallView className="mx_LeftPanel_callView"/> callPreview = <CallView className="mx_LeftPanel_callView" onClick={this.onCallViewClick} />
} }
return ( return (