Select input box on machine/distro/class pages

If there are no search results, focus the search input field and select
any text in it so that the user can just start typing a keyword
immediately.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-09-26 16:21:49 +12:00
parent f039aaa4f4
commit a4212901b1
3 changed files with 33 additions and 0 deletions

View File

@ -75,3 +75,14 @@
{% endautoescape %}
{% endblock %}
{% block scripts %}
<script>
{% if not class_list %}
$(document).ready(function() {
$("#filter-form input:text").first().select().focus();
});
{% endif %}
</script>
{% endblock %}

View File

@ -78,3 +78,14 @@
{% endautoescape %}
{% endblock %}
{% block scripts %}
<script>
{% if not distro_list %}
$(document).ready(function() {
$("#filter-form input:text").first().select().focus();
});
{% endif %}
</script>
{% endblock %}

View File

@ -77,3 +77,14 @@
{% endautoescape %}
{% endblock %}
{% block scripts %}
<script>
{% if not machine_list %}
$(document).ready(function() {
$("#filter-form input:text").first().select().focus();
});
{% endif %}
</script>
{% endblock %}