aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-12-09 08:42:01 +0000
committerMario <mario@mariovavti.com>2024-12-09 08:42:01 +0000
commit486c21b51910de5b5cdb2bb42a070f3971475530 (patch)
tree70e17007497ed02912942a4097b9733ac678e904 /view
parent7785487d776cdb5117f9a9206da9557ad2f59d0f (diff)
downloadvolse-hubzilla-486c21b51910de5b5cdb2bb42a070f3971475530.tar.gz
volse-hubzilla-486c21b51910de5b5cdb2bb42a070f3971475530.tar.bz2
volse-hubzilla-486c21b51910de5b5cdb2bb42a070f3971475530.zip
hq: improved file filtering
Diffstat (limited to 'view')
-rw-r--r--view/tpl/messages_widget.tpl12
1 files changed, 10 insertions, 2 deletions
diff --git a/view/tpl/messages_widget.tpl b/view/tpl/messages_widget.tpl
index df91a05ef..ebd76ec89 100644
--- a/view/tpl/messages_widget.tpl
+++ b/view/tpl/messages_widget.tpl
@@ -137,8 +137,15 @@
get_messages_page();
});
- $("#messages-file").on('change', function(data) {
- file = $("#messages-file").val();
+ $('#messages-file').on('input', function(e) {
+ file = e.currentTarget.value;
+
+ let datalist = document.getElementById('data_filetags');
+ let options = [...datalist.options].map(option => option.value);
+
+ if (!options.includes(file)) {
+ return;
+ }
$('#messages-container .message').remove();
$('#messages-file-container').addClass('active sticky-top');
@@ -154,6 +161,7 @@
$("#messages-file").attr('placeholder', '{{$strings.file_filter}}');
$('#messages-author-container').removeClass('active sticky-top');
+ $('#messages-file-container').removeClass('active sticky-top');
$('#messages-author-input-clear').addClass('d-none');
$('#messages-container .message').remove();
author = '';