Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:rl-institut-private/digiplan into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nesnoj committed May 8, 2024
2 parents 56c9629 + 974c08b commit b6a2ac8
Show file tree
Hide file tree
Showing 4 changed files with 707 additions and 702 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project tries to adhere to [Semantic Versioning](https://semver.org/spe
- update funding information

### Fixed
- show choropleth on revisit of status quo

## [1.0.1] - 2023-11-01
### Added
Expand Down
21 changes: 20 additions & 1 deletion digiplan/static/js/menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {resultsTabs, futureDropdown} from "./elements.js";
import {resultsTabs, statusquoDropdown, futureDropdown} from "./elements.js";

const menuNextBtn = document.getElementById("menu_next_btn");
const menuPreviousBtn = document.getElementById("menu_previous_btn");
Expand Down Expand Up @@ -26,12 +26,14 @@ chartTab.addEventListener("click", function () {
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, setMapChartViewVisibility);
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, showMapView);
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, hidePotentialLayers);
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, reactivateChoropleth);
PubSub.subscribe(eventTopics.MENU_SETTINGS_SELECTED, setMapChartViewVisibility);
PubSub.subscribe(eventTopics.MENU_SETTINGS_SELECTED, showMapView);
PubSub.subscribe(eventTopics.MENU_SETTINGS_SELECTED, deactivateChoropleth);
PubSub.subscribe(eventTopics.MENU_SETTINGS_SELECTED, terminateSimulation);
PubSub.subscribe(eventTopics.MENU_RESULTS_SELECTED, setMapChartViewVisibility);
PubSub.subscribe(eventTopics.MENU_RESULTS_SELECTED, hidePotentialLayers);
PubSub.subscribe(eventTopics.MENU_RESULTS_SELECTED, reactivateChoropleth);
PubSub.subscribe(eventTopics.MAP_VIEW_SELECTED, setResultsView);
PubSub.subscribe(eventTopics.CHART_VIEW_SELECTED, setResultsView);

Expand Down Expand Up @@ -92,6 +94,23 @@ function setMapChartViewVisibility(msg) {
return logMessage(msg);
}

function reactivateChoropleth(msg) {
let choropleth = "";
let infoToolTip = "";
if (msg === eventTopics.MENU_STATUS_QUO_SELECTED) {
choropleth = statusquoDropdown.value;
infoToolTip = statusquoDropdown.options[statusquoDropdown.selectedIndex].title;
} else {
choropleth = futureDropdown.value;
infoToolTip = futureDropdown.options[futureDropdown.selectedIndex].title;
}
if (choropleth !== "") {
PubSub.publish(mapEvent.CHOROPLETH_SELECTED, choropleth);
}
document.getElementById("info_tooltip_results").title = statusquoDropdown.options[statusquoDropdown.selectedIndex].title;
return logMessage(msg);
}

function setResultsView(msg) {
if (msg === eventTopics.CHART_VIEW_SELECTED) {
futureDropdown.parentElement.setAttribute("style", "display: none !important");
Expand Down
Loading

0 comments on commit b6a2ac8

Please sign in to comment.