Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix broken e2e tests and bugs breaking e2e tests #1119

Benjamin King596aa6a9ad93
diff --git a/web/js/components/sidebar/nav/nav-item.js b/web/js/components/sidebar/nav/nav-item.js
index 38c1d2d9c..2d2270995 100644
--- a/web/js/components/sidebar/nav/nav-item.js
+++ b/web/js/components/sidebar/nav/nav-item.js
@@ -27,6 +27,7 @@ class CustomNavItem extends React.Component {
disabled={isDisabled}
title={title}
className={className}
+ id={this.props.id + '-sidebar-tab'}
onClick={() => onTabClick(id)}
>
<i className={'productsIcon selected ' + iconClassName} />
diff --git a/web/js/sidebar/ui.js b/web/js/sidebar/ui.js
index 82b2648fc..8a417c68b 100644
--- a/web/js/sidebar/ui.js
+++ b/web/js/sidebar/ui.js
@@ -320,6 +320,7 @@ export function sidebarUi(models, config, ui) {
var layer;
var layerGroupString = models.layers.activeLayers;
var isCompareMode = models.compare && models.compare.active;
+
switch (typeOfUpdate) {
case 'remove':
models.layers.remove(layerId, layerGroupString);
@@ -332,12 +333,24 @@ export function sidebarUi(models, config, ui) {
updateState(getStateType(isCompareMode));
break;
case 'info':
- layer = lodashFind(models.layers[layerGroupString], { id: layerId });
- layersInfo(config, models, layer);
+ let $infoDialog = $('#wv-layers-info-dialog');
+ if ($infoDialog.attr('data-layer') !== layerId || $infoDialog.length === 0) {
+ layer = lodashFind(models.layers[layerGroupString], { id: layerId });
+ layersInfo(config, models, layer);
+ } else {
+ wvui.close();
+ }
+
break;
case 'options':
- layer = lodashFind(models.layers[layerGroupString], { id: layerId });
- layersOptions(config, models, layer, layerGroupString);
+ let $optionDialog = $('#wv-layers-options-dialog');
+ if ($optionDialog.attr('data-layer') !== layerId || $optionDialog.length === 0) {
+ layer = lodashFind(models.layers[layerGroupString], { id: layerId });
+ layersOptions(config, models, layer, layerGroupString);
+ } else {
+ wvui.close();
+ }
+
break;
case 'hover':
timelineDataHightlight(layerId, value);