Skip to content

Commit

Permalink
slider marks are also updated when scenario is chosen
Browse files Browse the repository at this point in the history
  • Loading branch information
josihoppe committed Apr 29, 2024
1 parent 6c0e34b commit 84000dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion digiplan/static/js/scenarios.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getCurrentMenuTab } from "./menu.js";
import { detailSliders, panelSliders } from "./sliders.js";
import { detailSliders, panelSliders, updateSliderMarks } from "./sliders.js";

const scenarioSettings = JSON.parse(
document.getElementById("scenario_settings").textContent,
Expand Down Expand Up @@ -148,6 +148,7 @@ function adaptSlidersScenario(msg, scenario) {
const sliderValue = scenarioSettings[scenario][slider.id];
$(`#${slider.id}`).data("ionRangeSlider").update({ from: sliderValue });
}
updateSliderMarks();
PubSub.publish(eventTopics.POWER_PANEL_SLIDER_CHANGE);
return logMessage(msg);
}
2 changes: 1 addition & 1 deletion digiplan/static/js/sliders.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function createPercentagesOfPowerSources(msg) {
}

/* when the other forms get Status Quo marks, there needs to be an iteration over the forms! (line 117)*/
function updateSliderMarks(msg) {
export function updateSliderMarks(msg) {
for (let [slider_name, slider_marks] of Object.entries(
store.cold.slider_marks,
)) {
Expand Down

0 comments on commit 84000dd

Please sign in to comment.