Fixed hijacking of browser search

This commit is contained in:
squidfunk 2017-04-20 18:28:28 +02:00 committed by Martin Donath
parent a54f57affc
commit 77e972753c
4 changed files with 8 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -150,7 +150,7 @@
{% endblock %} {% endblock %}
</div> </div>
{% block scripts %} {% block scripts %}
<script src="{{ base_url }}/assets/javascripts/application-0b7df094bf.js"></script> <script src="{{ base_url }}/assets/javascripts/application-ad1183cb07.js"></script>
<script>app.initialize({url:{base:"{{ base_url }}"}})</script> <script>app.initialize({url:{base:"{{ base_url }}"}})</script>
{% for path in extra_javascript %} {% for path in extra_javascript %}
<script src="{{ path }}"></script> <script src="{{ path }}"></script>

View File

@ -224,6 +224,10 @@ function initialize(config) { // eslint-disable-line func-style
if (!(query instanceof HTMLInputElement)) if (!(query instanceof HTMLInputElement))
throw new ReferenceError throw new ReferenceError
/* Abort if meta key (macOS) or ctrl key (Windows) is pressed */
if (ev.metaKey || ev.ctrlKey)
return
/* Search is open */ /* Search is open */
if (toggle.checked) { if (toggle.checked) {