mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 22:05:09 +01:00
Filter autocomplete
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
<div class="row">
|
||||
<form action="{{ url_for('bookmarks_page', userkey=userkey) }}" method="POST">
|
||||
<div class="input-field col l10 m10 s8">
|
||||
<input placeholder="search text" type="text" name="filter_text" id="filter_text" value="{{ filter_text }}" />
|
||||
<input placeholder="search text" type="text" name="filter_text" id="filter_text" class="autocomplete" value="{{ filter_text }}" />
|
||||
</div>
|
||||
|
||||
<div class="input-field col l2 m2 s4">
|
||||
@@ -79,3 +79,20 @@
|
||||
</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block extrajs %}
|
||||
<script>
|
||||
/* Search filter autocomplete */
|
||||
var options = {}
|
||||
var elem = document.querySelector('.autocomplete');
|
||||
var instance = M.Autocomplete.init(elem, options);
|
||||
instance.updateData({
|
||||
{% for bookmark in bookmarks %}
|
||||
{% if bookmark.favicon %}
|
||||
"{{ bookmark.title | replace('\n', '') }}": "{{ url_for('static', filename='favicons/' + bookmark.favicon) }}",
|
||||
{% else %}
|
||||
"{{ bookmark.title | replace('\n', '') }}": null,
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user