Add support for keybinding for settings
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.
This commit is contained in:
12
js/main.js
12
js/main.js
@@ -1,5 +1,6 @@
|
|||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
this.initBody();
|
this.initBody();
|
||||||
|
this.listenForSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -389,4 +390,15 @@ function extractQuickLinks(passedSqrs) {
|
|||||||
|
|
||||||
// Start the autocomplete
|
// Start the autocomplete
|
||||||
autocomplete(document.getElementById("search-bar-input"), this.validQuickLinks);
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user