Move current search in channel function to Shift+CTRL+S
Add search in team Closes #270
This commit is contained in:
@@ -81,6 +81,12 @@ var MainPage = React.createClass({
|
||||
webview.send('activate-search-box');
|
||||
});
|
||||
|
||||
// activate search box in current chunnel
|
||||
ipcRenderer.on('activate-search-box-in-channel', (event) => {
|
||||
let webview = document.getElementById('mattermostView' + thisObj.state.key);
|
||||
webview.send('activate-search-box-in-channel');
|
||||
});
|
||||
|
||||
var focusListener = function() {
|
||||
var webview = document.getElementById('mattermostView' + thisObj.state.key);
|
||||
webview.focus();
|
||||
|
@@ -142,6 +142,16 @@ function getCurrentChannelString() {
|
||||
}
|
||||
|
||||
ipc.on('activate-search-box', (event) => {
|
||||
const search_boxes = document.getElementsByClassName('search-bar'); // should use id
|
||||
if (search_boxes.length === 0) {
|
||||
return;
|
||||
}
|
||||
const search_box = search_boxes[0];
|
||||
search_box.focus();
|
||||
search_box.value = ``; //Clear the input box
|
||||
});
|
||||
|
||||
ipc.on('activate-search-box-in-channel', (event) => {
|
||||
const search_boxes = document.getElementsByClassName('search-bar'); // should use id
|
||||
if (search_boxes.length === 0) {
|
||||
return;
|
||||
|
@@ -70,13 +70,21 @@ var createTemplate = function(mainWindow, config) {
|
||||
}, {
|
||||
role: 'selectall'
|
||||
}, separatorItem, {
|
||||
label: 'Search in Channel',
|
||||
accelerator: 'CmdOrCtrl+F',
|
||||
label: 'Search in Team',
|
||||
accelerator: 'CmdOrCtrl+S',
|
||||
click: (item, focusedWindow) => {
|
||||
if (focusedWindow) {
|
||||
focusedWindow.webContents.send('activate-search-box');
|
||||
}
|
||||
}
|
||||
}, {
|
||||
label: 'Search in Channel',
|
||||
accelerator: 'Shift+CmdOrCtrl+S',
|
||||
click: (item, focusedWindow) => {
|
||||
if (focusedWindow) {
|
||||
focusedWindow.webContents.send('activate-search-box-in-channel');
|
||||
}
|
||||
}
|
||||
}]
|
||||
});
|
||||
template.push({
|
||||
|
Reference in New Issue
Block a user