Skip to content

Commit

Permalink
Improve filter menu suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-stoehr committed Jul 25, 2024
1 parent 5981cfa commit 78b5669
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<FilterString> processCategories = Arrays.asList(
FilterString.TASK,
FilterString.TASKINWORK,
Expand Down
4 changes: 2 additions & 2 deletions Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
6 changes: 1 addition & 5 deletions Kitodo/src/main/webapp/WEB-INF/resources/js/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 78b5669

Please sign in to comment.