Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Infowindow -headers scroll & window max-height #1881

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion scss/_infowindow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
width: 320px;
z-index: 1;
overflow: visible;
max-height: 90%;
&.expandable_list {
cursor: move;
}
Expand Down Expand Up @@ -40,11 +41,18 @@
cursor: move;
font-size: 12px;
font-weight: bold;
padding: 1em 1em 1em 2em;
padding: 1em 0em 1em 2em;
z-index: 10;
border-radius: inherit;
}

.urvalListContainer {
margin-right: 0.5em;
max-height: 10em;
overflow-y: scroll;
scroll-behavior: smooth;
}

.expandable_list {
.urval-textnode-container {
font-weight: bold;
Expand Down
6 changes: 5 additions & 1 deletion src/infowindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { dom, Button } from './ui';
let parentElement;
let mainContainer;
let urvalContainer;
let urvalListContainer;
let listContainer;
let exportContainer;
let groupFooterContainer;
Expand Down Expand Up @@ -111,6 +112,8 @@ function render(viewerId) {
mainContainer.id = 'sidebarcontainer';
urvalContainer = document.createElement('div');
urvalContainer.classList.add('urvalcontainer');
urvalListContainer = document.createElement('div');
urvalListContainer.classList.add('urvalListContainer');
// We add this so that urvalcontainer can become draggable
urvalContainer.id = 'sidebarcontainer-draggable';
const urvalTextNodeContainer = document.createElement('div');
Expand All @@ -120,6 +123,7 @@ function render(viewerId) {
urvalContainer.appendChild(urvalTextNodeContainer);
const closeButton = createCloseButton();
urvalContainer.appendChild(dom.html(closeButton.render()));
urvalContainer.appendChild(urvalListContainer);
listContainer = document.createElement('div');
listContainer.classList.add('listcontainer');

Expand Down Expand Up @@ -200,7 +204,7 @@ function createUrvalElement(selectionGroup, selectionGroupTitle) {
urvalElement.classList.add('urvalelement');
const textNode = document.createTextNode(selectionGroupTitle);
urvalElement.appendChild(textNode);
urvalContainer.appendChild(urvalElement);
urvalListContainer.appendChild(urvalElement);
urvalElements.set(selectionGroup, urvalElement);
urvalElement.addEventListener('click', () => {
showSelectedList(selectionGroup);
Expand Down
Loading