Merge pull request #113 from chiragjn/master

Fix issue #112 for displaying Keyboard shortcuts
This commit is contained in:
Akash Nimare
2017-02-24 14:35:48 +05:30
committed by GitHub

View File

@@ -45,10 +45,14 @@ ipcRenderer.on('log-out', () => {
ipcRenderer.on('shortcut', () => {
// create the menu for the below
document.querySelector('.dropdown-toggle').click();
const nodes = document.querySelectorAll('.dropdown-menu li:nth-child(4) a');
nodes[nodes.length - 1].click();
const node = document.querySelector('a[data-overlay-trigger=keyboard-shortcuts]');
// additional check
if (node.text.trim().toLowerCase() === 'keyboard shortcuts') {
node.click();
} else {
// atleast click the dropdown
document.querySelector('.dropdown-toggle').click();
}
});
// To prevent failing this script on linux we need to load it after the document loaded