Add search functionality to public corpora page

This commit is contained in:
Patrick Jentsch 2022-12-07 14:12:30 +01:00
parent f056a15ba8
commit 65c907a990

View File

@ -9,12 +9,10 @@
<h1 id="title"><i class="nopaque-icons" style="font-size: inherit;">I</i>Corpora</h1>
</div>
<div class="white" style="padding: 0 15px; border-radius: 20px;">
<form>
<div class="input-field">
<i class="material-icons prefix">search</i>
<input id="search" placeholder="Find public corpora" type="text">
</div>
</form>
<div class="input-field">
<i class="material-icons prefix">search</i>
<input id="public-corpora-search" placeholder="Find public corpora" type="text">
</div>
</div>
</div>
</div>
@ -38,7 +36,9 @@
{% block scripts %}
{{ super() }}
<script>
let publicCorporaSearchElement = document.querySelector('#public-corpora-search');
let corpusList = CorpusList.getInstance(document.querySelector('#corpora .corpus-list .list'));
publicCorporaSearchElement.addEventListener('keyup', function() {corpusList.listjs.search(this.value);});
corpusList._init({{ corpora|tojson }});
</script>
{% endblock scripts %}