Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-2441: Fix layer picker modal scrolling (#3977)

Ryan Weilera1a67767b61c
diff --git a/web/js/containers/sidebar/footer-content.js b/web/js/containers/sidebar/footer-content.js
index 414b3f117..cf0922673 100644
--- a/web/js/containers/sidebar/footer-content.js
+++ b/web/js/containers/sidebar/footer-content.js
@@ -6,6 +6,7 @@ import {
UncontrolledTooltip,
} from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { isMobileOnly, isTablet } from 'react-device-detect';
import Button from '../../components/util/button';
import ModeSelection from '../../components/sidebar/mode-selection';
import { toggleCompareOnOff, changeMode } from '../../modules/compare/actions';
@@ -139,8 +140,8 @@ const mapDispatchToProps = (dispatch) => ({
changeCompareMode: (str) => {
dispatch(changeMode(str));
},
- addLayers: (isPlaying, isMobile, breakpoints, screenWidth) => {
- const modalClassName = isMobile || screenWidth < breakpoints.medium ? 'custom-layer-dialog-mobile custom-layer-dialog light' : 'custom-layer-dialog light';
+ addLayers: (isPlaying) => {
+ const modalClassName = isMobileOnly || isTablet ? 'custom-layer-dialog-mobile custom-layer-dialog light' : 'custom-layer-dialog light';
if (isPlaying) {
dispatch(stopAnimationAction());
}
diff --git a/web/scss/components/facets.scss b/web/scss/components/facets.scss
index 21dd6dd69..e5033c62f 100644
--- a/web/scss/components/facets.scss
+++ b/web/scss/components/facets.scss
@@ -3,6 +3,7 @@
max-width: 270px;
display: flex;
flex-direction: column;
+ overflow-y: auto;
& .bag-o-chips {
background: #333;
diff --git a/web/scss/features/layers.scss b/web/scss/features/layers.scss
index 36a429abc..49d044e42 100644
--- a/web/scss/features/layers.scss
+++ b/web/scss/features/layers.scss
@@ -386,6 +386,11 @@
color: #ccc;
}
+.layer_picker_component .modal {
+ // max-height: 90vh;
+ overflow-y: hidden;
+}
+
.custom-layer-dialog {
margin: 5px auto;
border: none;
@@ -450,7 +455,7 @@
}
.search-layers-container {
- height: 100%;
+ overflow-y: auto;
display: flex;
& .layer-list-detail-container {
@@ -721,7 +726,7 @@
}
}
-@media (min-width: $tablet-min-width) {
+@media (min-width: $desktop-min-width) {
.search-layers-container {
& div.layer-list-detail-container {
flex-direction: row;
@@ -766,18 +771,138 @@
}
}
+@media (min-width: $tablet-min-width) {
+ .category-width .layer-modal-content {
+ height: calc(var(--vh, 1vh) * 100 - 135px);
+ }
+
+ .browse-search-width .layer-modal-content {
+ height: calc(var(--vh, 1vh) * 100 - 155px);
+ }
+
+ .browse-search-width .search-layers-container.browse {
+ height: calc(var(--vh, 1vh) * 100 - 195px);
+ }
+
+ .browse-search-width .search-layers-container.recent-layers {
+ height: calc(var(--vh, 1vh) * 100 - 235px);
+ }
+}
+
+@media (max-width: $mobile-max-width) {
+ .category-width .layer-modal-content {
+ padding: 0;
+ height: calc(var(--vh, 1vh) * 100 - 40px);
+ }
+
+ .browse-search-width .layer-modal-content {
+ padding: 0;
+ height: calc(var(--vh, 1vh) * 100 - 70px);
+ }
+
+ .browse-search-width .search-layers-container.browse {
+ height: calc(var(--vh, 1vh) * 100 - 122px);
+ }
+
+ .browse-search-width .search-layers-container.recent-layers {
+ height: calc(var(--vh, 1vh) * 100 - 95px);
+ }
+
+ .layer-modal-content > .results-text {
+ font-size: 12px !important;
+ }
+
+ .custom-layer-dialog {
+ &.browse-search-width,
+ &.category-width {
+ width: 100%;
+ height: 100%;
+ max-width: 100%;
+ margin: 0;
+ }
+
+ &.browse-search-width .product-outter-list-case {
+ width: 100%;
+ }
+
+ &.category-width .modal-body {
+ padding: 0 4px;
+ }
+
+ &.category-width .search-layers-container {
+ height: initial;
+ }
+
+ &.category-width .layer-list-container.browse {
+ border-right: none;
+ padding: 0;
+ }
+
+ .modal-content {
+ border-radius: 0;
+ border: none;
+ }
+
+ .modal-header {
+ padding: 5px 10px;
+
+ & .header-filter-container .results-text {
+ text-align: right;
+ font-size: 16px;
+ }
+ }
+ }
+
+ .category-masonry-case .layer-category {
+ width: 100%;
+ }
+
+ .category-background-cover {
+ background-size: cover;
+ }
+
+ .layer-modal-content .categories-nav {
+ .nav-item {
+ margin: 0 8px 0 0;
+ }
+
+ .nav-link {
+ font-size: 11px;
+ padding: 1px 7px;
+ margin: 0;
+ }
+ }
+
+ .layers-all-layer .search-row .wv-checkbox {
+ left: 4px;
+
+ &::before {
+ font-size: 20px;
+ line-height: 25px;
+ height: 30px;
+ width: 30px;
+ }
+ }
+}
+
+.layer-detail-container.search {
+ border-top: 5px solid #d54e21;
+ padding-left: 2px;
+ background-image: linear-gradient(#aaa, #ddd 15%);
+}
+
.custom-layer-dialog-mobile {
width: 100% !important;
max-width: 100% !important;
- margin: 0 !important;
+ margin: 0;
height: 100%;
& .modal-body {
- padding: 0 0 0 8px;
+ padding: 0;
}
&.browse-search-width {
- width: 95%;
+ width: 100%;
max-width: 800px;
}