Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add Gray border when granule selected #1815

Benjamin King99d7832a1922
diff --git a/web/js/map/data/ui.js b/web/js/map/data/ui.js
index 3333a1c27..2c66322b2 100644
--- a/web/js/map/data/ui.js
+++ b/web/js/map/data/ui.js
@@ -52,10 +52,10 @@ export function dataUi(store, ui, config) {
case DATA_CONSTANTS.DATA_GET_DATA_CLICK:
return self.showDownloadList();
case DATA_CONSTANTS.DATA_GRANULE_SELECT:
- self.events.on('granuleSelect', action.granule);
+ self.events.trigger('granuleSelect', action.granule);
return updateSelection();
case DATA_CONSTANTS.DATA_GRANULE_UNSELECT:
- self.events.on('granuleUnselect', action.granule);
+ self.events.trigger('granuleUnselect', action.granule);
return updateSelection();
case LAYER_CONSTANTS.REMOVE_LAYER:
case LAYER_CONSTANTS.RESET_LAYERS:
diff --git a/web/js/map/ui.js b/web/js/map/ui.js
index 35323cbde..c6af66cd5 100644
--- a/web/js/map/ui.js
+++ b/web/js/map/ui.js
@@ -929,6 +929,8 @@ export function mapui(models, config, store, ui) {
};
map.on('rendercomplete', onRenderComplete);
map.on('click', function(e) {
+ const { data } = store.getState();
+ if (data.active) return;
var metaTitle;
var def;
var metaArray = [];
diff --git a/web/js/modules/data/reducers.js b/web/js/modules/data/reducers.js
index d137029cb..75dee1a55 100644
--- a/web/js/modules/data/reducers.js
+++ b/web/js/modules/data/reducers.js
@@ -4,10 +4,12 @@ import {
DATA_GRANULE_UNSELECT
} from './constants';
import { assign as lodashAssign } from 'lodash';
+import { CHANGE_TAB } from '../sidebar/constants';
export const defaultDataState = {
selectedProduct: '',
selectedGranules: {},
- prefer: 'science'
+ prefer: 'science',
+ active: false
};
export default function dataDownloadReducer(state = defaultDataState, action) {
switch (action.type) {
@@ -20,6 +22,10 @@ export default function dataDownloadReducer(state = defaultDataState, action) {
return lodashAssign({}, state, {
selectedGranules: action.selectedGranules
});
+ case CHANGE_TAB:
+ return lodashAssign({}, state, {
+ active: action.activeTab === 'download'
+ });
default:
return state;
}