We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03f62c1 commit 76dafdbCopy full SHA for 76dafdb
2 files changed
static/js/search-shortcut.js
@@ -0,0 +1,14 @@
1
+/**
2
+ * Keyboard shortcut: Ctrl+K / Cmd+K opens the Boost Gecko search modal.
3
+ */
4
+(function () {
5
+ 'use strict';
6
+
7
+ document.addEventListener('keydown', function (e) {
8
+ if ((e.ctrlKey || e.metaKey) && e.key === 'k') {
9
+ e.preventDefault();
10
+ var searchBtn = document.getElementById('gecko-search-button');
11
+ if (searchBtn) searchBtn.click();
12
+ }
13
+ });
14
+})();
templates/base.html
@@ -430,6 +430,7 @@
430
{% flag "v3" %}
431
<script src="{% static 'js/carousel.js' %}" defer></script>
432
<script src="{% static 'js/dialog.js' %}" defer></script>
433
+ <script src="{% static 'js/search-shortcut.js' %}" defer></script>
434
{% endflag %}
435
436
{% block footer_js %}{% endblock %}
0 commit comments