mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 21:18:16 -06:00
Only autofocus on desktop navbar
This commit is contained in:
parent
5063129979
commit
b13f03e0c6
@ -33,7 +33,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex my-1 flex-grow-1 justify-content-center w-100">
|
<div class="d-flex my-1 flex-grow-1 justify-content-center w-100">
|
||||||
{% search_options request %}
|
{% search_options request "mobile" %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
{# Search bar #}
|
{# Search bar #}
|
||||||
<div class="col-6 d-flex flex-grow-1 justify-content-center">
|
<div class="col-6 d-flex flex-grow-1 justify-content-center">
|
||||||
{% search_options request %}
|
{% search_options request "desktop" %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{# Proflie/login button #}
|
{# Proflie/login button #}
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
aria-label="Search"
|
aria-label="Search"
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
value=""
|
{% if navbar == "mobile" %}
|
||||||
{% if request.GET.q %}
|
value="{{ request.GET.q|escape }}"
|
||||||
autofocus
|
{% else %}
|
||||||
onfocus="this.value = '{{ request.GET.q|escapejs }}';"
|
value="" autofocus onfocus="this.value = '{{ request.GET.q|escapejs }}';"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -8,9 +8,10 @@ search_form = SearchForm()
|
|||||||
|
|
||||||
|
|
||||||
@register.inclusion_tag("search/searchbar.html")
|
@register.inclusion_tag("search/searchbar.html")
|
||||||
def search_options(request) -> Dict:
|
def search_options(request, navbar) -> Dict:
|
||||||
"""Provide search options to template."""
|
"""Provide search options to template."""
|
||||||
return {
|
return {
|
||||||
'options': search_form.options,
|
'options': search_form.options,
|
||||||
'request': request,
|
'request': request,
|
||||||
|
'navbar' : navbar,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user