Remove Ctrl+S shortcut for searching within a team

Close #416
This commit is contained in:
Yuya Ochiai
2017-02-03 23:24:26 +09:00
parent ca5632342e
commit 11f79b3f11
3 changed files with 1 additions and 35 deletions

View File

@@ -15,6 +15,7 @@ Release date: TBD
#### All Platforms
- Suppress white screen which is displayed for a moment on startup
- Support unread indications in team sidebar of Mattermost server 3.6
- Remove confusing `Ctrl(CMD)+S` shortcut for searching within a team
### Bug Fixes

View File

@@ -146,30 +146,3 @@ notification.override({
ipc.sendToHost('onNotificationClick');
}
});
// get the last of href for the current channel in the sidebar.
function getCurrentChannelString() {
const activeChannelLink = document.querySelector('.active a.sidebar-channel');
const urlElements = activeChannelLink.href.split('/');
return urlElements[urlElements.length - 1];
}
ipc.on('activate-search-box', () => {
const searchBoxes = document.getElementsByClassName('search-bar'); // should use id
if (searchBoxes.length === 0) {
return;
}
const searchBox = searchBoxes[0];
searchBox.focus();
searchBox.value = ''; //Clear the input box
});
ipc.on('activate-search-box-in-channel', () => {
const searchBoxes = document.getElementsByClassName('search-bar'); // should use id
if (searchBoxes.length === 0) {
return;
}
const searchBox = searchBoxes[0];
searchBox.focus();
searchBox.value = `in:${getCurrentChannelString()} `;
});

View File

@@ -69,14 +69,6 @@ function createTemplate(mainWindow, config) {
role: 'paste'
}, {
role: 'selectall'
}, separatorItem, {
label: 'Search in Team',
accelerator: 'CmdOrCtrl+S',
click: (item, focusedWindow) => {
if (focusedWindow) {
focusedWindow.webContents.send('activate-search-box');
}
}
}]
});
template.push({