Add Ctrl+n shortcut to switch tab

This also shows the main window.
Close #51
This commit is contained in:
Yuya Ochiai
2016-05-18 23:02:03 +09:00
parent e2d7d18804
commit 8f936c1725
3 changed files with 22 additions and 6 deletions

View File

@@ -54,6 +54,9 @@ var MainPage = React.createClass({
loginQueue: loginQueue
});
});
ipcRenderer.on('switch-tab', (event, key) => {
this.handleSelect(key);
});
var focusListener = function() {
var webview = document.getElementById('mattermostView' + thisObj.state.key);
@@ -69,8 +72,9 @@ var MainPage = React.createClass({
});
},
handleSelect: function(key) {
const newKey = key % this.props.teams.length;
this.setState({
key: key
key: newKey
});
this.handleOnTeamFocused(key);
},