Skip to content

Commit

Permalink
Final adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
jokd committed Nov 2, 2023
1 parent d6714c9 commit 085779b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scss/externs/_awesomplete.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
position: absolute;
top: 40px;
z-index: 1;
overflow-y: auto;
}

.awesomplete.black > ul {
Expand All @@ -47,7 +48,6 @@
top: auto;
bottom: 100%;
z-index: 9999999;
max-height: 100%;
overflow-y: auto;
}

Expand Down
1 change: 0 additions & 1 deletion src/controls/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ const Legend = function Legend(options = {}) {
}
});
awesomplete.ul.style.maxHeight = `${calcMaxHeight(getTargetHeight()) / 2}px`;
awesomplete.ul.style.overflowY = 'auto';
input.parentNode.classList.add('black');
input.parentNode.classList.add('grow');
input.addEventListener('keyup', (e) => {
Expand Down
6 changes: 3 additions & 3 deletions src/controls/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ const Search = function Search(options = {}) {

function initAutocomplete() {
const input = document.getElementsByClassName('o-search-field')[0];
const mapEl = viewer.getMap().getTargetElement();
const listHeight = mapEl.offsetHeight / 2;

awesomplete = new Awesomplete('.o-search-field', {
minChars: minLength,
Expand All @@ -324,10 +326,8 @@ const Search = function Search(options = {}) {
return suggestionValue.toLowerCase().includes(userInput.toLowerCase()) ? suggestionValue : false;
}
});
const mapEl = viewer.getMap().getTargetElement();
const listHeight = mapEl.offsetHeight / 2;
awesomplete.ul.style.maxHeight = `${listHeight}px`;
awesomplete.ul.style.overflowY = 'auto';

const handler = function func(list) {
awesomplete.list = list;
awesomplete.evaluate();
Expand Down

0 comments on commit 085779b

Please sign in to comment.