Skip to content

Commit

Permalink
Bugfix: Hiding Wind/Solar-Euro in Graph + delete radio button selecti…
Browse files Browse the repository at this point in the history
…on if selection is changed in dropdown
  • Loading branch information
JetteThiele committed Jan 9, 2025
1 parent e3fcad9 commit 352bbb8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion slapp/kommWertTool/cal_mun_rev.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def create_echarts_data_total_mun_income(trade_tax_plant, eeg_income, sr_bb_inco
def add_series(name, data, yAxisIndex=0):
if any(value > 0 for value in data):
series_data.append({"name": name, "type": "bar", "data": data, "yAxisIndex": yAxisIndex})
if yAxisIndex == 0:
if yAxisIndex == 0 and any(value > 0 for value in data):
legend_data.append(name)


Expand Down
15 changes: 12 additions & 3 deletions slapp/kommWertTool/templates/added_value_calc.html
Original file line number Diff line number Diff line change
Expand Up @@ -730,19 +730,28 @@ <h6 class="mb-0"><b>Optional</b></h6>
var selectedRadio = document.querySelector('input[name="check_county"]:checked');
var countyName = selectedRadio ? selectedRadio.getAttribute('data-name') : null;

function resetRadioButtons() {
const radioButtons = document.querySelectorAll('#check_county input[type="radio"]');
radioButtons.forEach(button => {
button.checked = false;
});
}

if (municipalityName === 'Kiel') {
windEuroShareDiv.style.display = 'none';
countyCheckDiv.style.display = 'none';
resetRadioButtons();
} else if (municipalityName === 'own_county') {
countyCheckDiv.style.display = 'block';
if (countyName === 'check_county_sh') {
windEuroShareDiv.style.display = 'none';
} else {
if (countyName === 'check_county_bb') {
windEuroShareDiv.style.display = 'block';
} else {
windEuroShareDiv.style.display = 'none';
}
} else {
windEuroShareDiv.style.display = 'block';
countyCheckDiv.style.display = 'none';
resetRadioButtons();
}
}

Expand Down

0 comments on commit 352bbb8

Please sign in to comment.