Skip to content

Commit

Permalink
Add support for keybinding for settings
Browse files Browse the repository at this point in the history
The settings menu will now be shown if the ctrl+, is pressed. This fixes
the issue of no way to get Settings if the search bar is hidden.
  • Loading branch information
deepjyoti30 committed Sep 14, 2020
1 parent d9ca19a commit c536886
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
window.onload = function() {
this.initBody();
this.listenForSettings();
}


Expand Down Expand Up @@ -389,4 +390,15 @@ function extractQuickLinks(passedSqrs) {

// Start the autocomplete
autocomplete(document.getElementById("search-bar-input"), this.validQuickLinks);
}


// Listen to key click

function listenForSettings() {
document.onkeyup = event => {
// Show the settings if ctrl and , is pressed
if (event.ctrlKey && event.which == 188)
showSettings();
}
}

0 comments on commit c536886

Please sign in to comment.