@@ -75,6 +75,12 @@ var MainPage = React.createClass({
|
||||
this.refs[`mattermostView${this.state.key}`].clearCacheAndReload();
|
||||
});
|
||||
|
||||
// activate search box in current tab
|
||||
ipcRenderer.on('activate-search-box', (event) => {
|
||||
let webview = document.getElementById('mattermostView' + thisObj.state.key);
|
||||
webview.send('activate-search-box');
|
||||
});
|
||||
|
||||
var focusListener = function() {
|
||||
var webview = document.getElementById('mattermostView' + thisObj.state.key);
|
||||
webview.focus();
|
||||
|
@@ -127,3 +127,16 @@ notification.override({
|
||||
ipc.sendToHost('onNotificationClick');
|
||||
}
|
||||
});
|
||||
|
||||
// get the last of href for the current channel in the sidebar.
|
||||
function getCurrentChannelString() {
|
||||
const active_channel_link = document.querySelector('.active a.sidebar-channel');
|
||||
const url_elements = active_channel_link.href.split('/');
|
||||
return url_elements[url_elements.length - 1];
|
||||
}
|
||||
|
||||
ipc.on('activate-search-box', (event) => {
|
||||
const search_box = document.getElementsByClassName('search-bar')[0]; // should use id
|
||||
search_box.focus();
|
||||
console.log(getCurrentChannelString());
|
||||
});
|
||||
|
Reference in New Issue
Block a user