diff --git a/modules/ui/background.js b/modules/ui/background.js index 0e0b67bab..bafba8d20 100644 --- a/modules/ui/background.js +++ b/modules/ui/background.js @@ -28,6 +28,8 @@ import { tooltip } from '../util/tooltip'; export function uiBackground(context) { var key = t('background.key'); + var pane = d3_select(null); + var _customSource = context.background().findSource('custom'); var _previousBackground = context.background().findSource(context.storage('background-last-used-toggle')); var _shown = false; @@ -282,8 +284,13 @@ export function uiBackground(context) { function update() { - updateBackgroundList(); - updateOverlayList(); + if (!pane.select('.disclosure-wrap-background_list').classed('hide')) { + updateBackgroundList(); + } + + if (!pane.select('.disclosure-wrap-overlay_list').classed('hide')) { + updateOverlayList(); + } _displayOptionsContainer .call(backgroundDisplayOptions); @@ -348,7 +355,7 @@ export function uiBackground(context) { } - var pane = selection + pane = selection .append('div') .attr('class', 'fillL map-pane hide'); diff --git a/modules/ui/map_data.js b/modules/ui/map_data.js index f560c8ffe..2f115a9f3 100644 --- a/modules/ui/map_data.js +++ b/modules/ui/map_data.js @@ -24,6 +24,8 @@ export function uiMapData(context) { var settingsCustomData = uiSettingsCustomData(context) .on('change', customChanged); + var pane = d3_select(null); + var _fillSelected = context.storage('area-fill') || 'partial'; var _shown = false; var _dataLayerContainer = d3_select(null); @@ -593,9 +595,15 @@ export function uiMapData(context) { function update() { - updateDataLayers(); - updateFillList(); - updateFeatureList(); + if (!pane.select('.disclosure-wrap-data_layers').classed('hide')) { + updateDataLayers(); + } + if (!pane.select('.disclosure-wrap-fill_area').classed('hide')) { + updateFillList(); + } + if (!pane.select('.disclosure-wrap-map_features').classed('hide')) { + updateFeatureList(); + } _QAList .call(drawListItems, ['keep-right'], 'checkbox', 'QA', function(d) { toggleLayer(d); }, showsQA); @@ -663,7 +671,7 @@ export function uiMapData(context) { } - var pane = selection + pane = selection .append('div') .attr('class', 'fillL map-pane hide');