From 78b5669f3360cd1425fac65c6b911c3eeb4566ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6hr?= Date: Thu, 25 Jul 2024 11:46:07 +0200 Subject: [PATCH] Improve filter menu suggestions --- .../main/java/org/kitodo/production/filters/FilterMenu.java | 2 +- Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css | 4 ++-- Kitodo/src/main/webapp/WEB-INF/resources/js/filter.js | 6 +----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Kitodo/src/main/java/org/kitodo/production/filters/FilterMenu.java b/Kitodo/src/main/java/org/kitodo/production/filters/FilterMenu.java index d4c9ae0d9f1..b509e9d366c 100644 --- a/Kitodo/src/main/java/org/kitodo/production/filters/FilterMenu.java +++ b/Kitodo/src/main/java/org/kitodo/production/filters/FilterMenu.java @@ -32,7 +32,7 @@ public class FilterMenu { - private static final int MAX_SUGGESTIONS = 15; + private static final int MAX_SUGGESTIONS = 100; private static final List processCategories = Arrays.asList( FilterString.TASK, FilterString.TASKINWORK, diff --git a/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css b/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css index c349f33e67a..fd45f388ad2 100644 --- a/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css +++ b/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css @@ -881,8 +881,6 @@ label.ui-outputlabel[for] { #filterOptionsFormWrapper { box-shadow: var(--second-level-shadow); display: none; - overflow-x: hidden; - overflow-y: scroll; position: absolute; top: 100%; z-index: 1; @@ -900,6 +898,8 @@ label.ui-outputlabel[for] { #filterOptionsForm\:suggestions { border-bottom: solid var(--contrast-border-width) var(--medium-gray); margin-bottom: var(--default-full-size); + max-height: calc(100vh - 350px); + overflow-x: auto; } #filterOptionsForm\:suggestions .selected { diff --git a/Kitodo/src/main/webapp/WEB-INF/resources/js/filter.js b/Kitodo/src/main/webapp/WEB-INF/resources/js/filter.js index b287a127a64..b9aeb3433d7 100644 --- a/Kitodo/src/main/webapp/WEB-INF/resources/js/filter.js +++ b/Kitodo/src/main/webapp/WEB-INF/resources/js/filter.js @@ -11,7 +11,6 @@ /* globals removeFilter, updateSuggestions, submitFilters, filterKeydownEvents */ /* Define identifiers used to select elements */ -const LIST_WRAPPER = "#listWrapper"; const FILTER_INPUT_FORM = "#filterInputForm"; const FILTER_INPUT = "#filterInputForm\\:filterfield"; const FILTER_INPUT_PARSED_FILTERS_AND_OPTIONS_FORMS = "#filterInputForm, #parsedFiltersForm, #filterOptionsForm"; @@ -147,12 +146,9 @@ function handleKeydown(event) { } /** - * Calculate the maximum height and display the filter options overlay. + * Display the filter options overlay. */ function openFilterOptionsMenu() { - let distanceWrapperToMenuTop = $(FILTER_INPUT).offset().top - $(LIST_WRAPPER).offset().top + $(FILTER_INPUT).height(); - let maxMenuHeight = $(LIST_WRAPPER).height() - distanceWrapperToMenuTop - 20; - $(FILTER_OPTIONS_FORM_WRAPPER).css("max-height", maxMenuHeight + "px"); $(FILTER_OPTIONS_FORM_WRAPPER).show(); }