Only show find as you type if enough templates

The find as you type only becomes useful once you have too many
templates to quickly scan visually on the page. I reckon that 7 is the
number where this starts becoming tricky. About 5 fit on the page
without scrolling (on my Macbook).
This commit is contained in:
Chris Hill-Scott
2017-03-17 16:10:43 +00:00
parent 04a5833d30
commit de30558d57

View File

@@ -47,14 +47,16 @@
{% endif %}
</div>
<div data-module="autofocus">
<div class="live-search" data-module="live-search" data-targets="#template-list .column-whole">
{{ textbox(
search_form.search,
width='1-1'
) }}
{% if templates|length > 7 %}
<div data-module="autofocus">
<div class="live-search" data-module="live-search" data-targets="#template-list .column-whole">
{{ textbox(
search_form.search,
width='1-1'
) }}
</div>
</div>
</div>
{% endif %}
<nav class="grid-row" id=template-list>
{% for template in templates %}