From ae8f2fa34255a33aff639fb5a5cfde65d39a33c9 Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Mon, 20 Nov 2023 21:36:46 +0100 Subject: [PATCH] Fix people and space filters (#6656) Co-authored-by: Lucas Bartholemy --- CHANGELOG.md | 1 + static/js/humhub/humhub.cards.js | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee774e9057..a412cb3a62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ HumHub Changelog - Fix #6645: File dropdown not visible at the bottom of the page - Fix #6639: Apply image inline styles in email message - Fix #6649: Fix birthday format on welcome page +- Fix #6656: Fix people and space filters - Fix #6652: Fix profile update on welcome page - Fix #6660: Fix memory usage on integrity check diff --git a/static/js/humhub/humhub.cards.js b/static/js/humhub/humhub.cards.js index 7b20b4ad96..6d51169bf0 100644 --- a/static/js/humhub/humhub.cards.js +++ b/static/js/humhub/humhub.cards.js @@ -3,11 +3,17 @@ humhub.module('cards', function(module, require, $) { const loader = require('ui.loader'); const applyFilters = function(evt) { - const form = $(evt.$trigger).closest('form'); - form.find('select[data-select2-id] option[data-id]').each(function() { - $(this).val($(this).data('id')); + $(evt.$trigger).closest('form').submit(); + } + + const initFiltersForm = function () { + const form = $('form.form-search'); + form.find('input[type=text]:first').focus(); + form.on('submit', function () { + $(this).find('select[data-select2-id] option[data-id]').each(function() { + $(this).val($(this).data('id')); + }); }); - form.submit(); } const selectTag = function (evt) { @@ -115,7 +121,7 @@ humhub.module('cards', function(module, require, $) { const init = function() { hideLastNotCompletedRow(); - $('input.form-search-filter[name=keyword]').focus(); + initFiltersForm(); initScroll(); }