Fill the search box with the current channel name at the shortcut
For #229
This commit is contained in:
parent
647e396fad
commit
e377d33652
|
@ -136,7 +136,11 @@ function getCurrentChannelString() {
|
|||
}
|
||||
|
||||
ipc.on('activate-search-box', (event) => {
|
||||
const search_box = document.getElementsByClassName('search-bar')[0]; // should use id
|
||||
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();
|
||||
console.log(getCurrentChannelString());
|
||||
search_box.value = `in:${getCurrentChannelString()} `;
|
||||
});
|
||||
|
|
|
@ -70,7 +70,7 @@ var createTemplate = function(mainWindow, config) {
|
|||
}, {
|
||||
role: 'selectall'
|
||||
}, separatorItem, {
|
||||
label: 'Search in Current Channel',
|
||||
label: 'Search in Channel',
|
||||
accelerator: 'CmdOrCtrl+F',
|
||||
click: (item, focusedWindow) => {
|
||||
if (focusedWindow) {
|
||||
|
|
Loading…
Reference in a new issue