Fixes an issue where panel sections wouldn't render when toggled if hidden on page load (closes #5743)

This commit is contained in:
Quincy Morgan
2019-01-21 15:22:50 -05:00
parent 92f1c4964f
commit 35ac247ff0
2 changed files with 34 additions and 6 deletions
+16 -4
View File
@@ -251,6 +251,8 @@ export function uiBackground(context) {
.attr('href', 'https://github.com/openstreetmap/iD/blob/master/FAQ.md#how-can-i-report-an-issue-with-background-imagery')
.append('span')
.text(t('background.imagery_source_faq'));
updateBackgroundList();
}
@@ -263,15 +265,25 @@ export function uiBackground(context) {
.attr('class', 'layer-list layer-overlay-list')
.attr('dir', 'auto')
.merge(container);
updateOverlayList();
}
function updateBackgroundList() {
_backgroundList
.call(drawListItems, 'radio', chooseBackground, function(d) { return !d.isHidden() && !d.overlay; });
}
function updateOverlayList() {
_overlayList
.call(drawListItems, 'checkbox', chooseOverlay, function(d) { return !d.isHidden() && d.overlay; });
}
function update() {
_backgroundList
.call(drawListItems, 'radio', chooseBackground, function(d) { return !d.isHidden() && !d.overlay; });
_overlayList
.call(drawListItems, 'checkbox', chooseOverlay, function(d) { return !d.isHidden() && d.overlay; });
updateBackgroundList();
updateOverlayList();
_displayOptionsContainer
.call(backgroundDisplayOptions);
+18 -2
View File
@@ -542,6 +542,8 @@ export function uiMapData(context) {
.append('div')
.attr('class', 'data-layer-container')
.merge(container);
updateDataLayers();
}
@@ -553,6 +555,8 @@ export function uiMapData(context) {
.append('ul')
.attr('class', 'layer-list layer-fill-list')
.merge(container);
updateFillList();
}
@@ -564,22 +568,34 @@ export function uiMapData(context) {
.append('ul')
.attr('class', 'layer-list layer-feature-list')
.merge(container);
updateFeatureList();
}
function update() {
function updateDataLayers() {
_dataLayerContainer
.call(drawOsmItems)
.call(drawQAItems)
.call(drawPhotoItems)
.call(drawCustomDataItems)
.call(drawVectorItems); // Beta - Detroit mapping challenge
}
function updateFillList() {
_fillList
.call(drawListItems, fills, 'radio', 'area_fill', setFill, showsFill);
}
function updateFeatureList() {
_featureList
.call(drawListItems, features, 'checkbox', 'feature', clickFeature, showsFeature);
}
function update() {
updateDataLayers();
updateFillList();
updateFeatureList();
_QAList
.call(drawListItems, ['keep-right'], 'checkbox', 'QA', function(d) { toggleLayer(d); }, showsQA);