Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
Showing only changes of commit 75ce1ccd31 - Show all commits

View File

@ -134,6 +134,7 @@
timelineContainer.removeEventListener("mousemove", onMouseMove); timelineContainer.removeEventListener("mousemove", onMouseMove);
handleMoving = false; handleMoving = false;
func_call(); func_call();
savePeriodInLocalStorage();
} }
timelineContainer.addEventListener("mousemove", onMouseMove); timelineContainer.addEventListener("mousemove", onMouseMove);
@ -167,6 +168,7 @@
snapHandlesToQuarters(); snapHandlesToQuarters();
timelineContainer.removeEventListener("mousemove", onMouseMove); timelineContainer.removeEventListener("mousemove", onMouseMove);
func_call(); func_call();
savePeriodInLocalStorage();
} }
timelineContainer.addEventListener("mousemove", onMouseMove); timelineContainer.addEventListener("mousemove", onMouseMove);
timelineContainer.addEventListener("touchmove", onMouseMove); timelineContainer.addEventListener("touchmove", onMouseMove);
@ -265,6 +267,7 @@
snapHandlesToQuarters(); snapHandlesToQuarters();
updatePeriodTimeLabel() updatePeriodTimeLabel()
func_call(); func_call();
savePeriodInLocalStorage();
} }
function snapHandlesToQuarters() { function snapHandlesToQuarters() {
@ -310,9 +313,23 @@
} }
} }
function savePeriodInLocalStorage(){
const dates = getPeriodValues();
localStorage.setItem("sco-timeline-values", JSON.stringify(dates));
}
function loadPeriodFromLocalStorage(){
const dates = JSON.parse(localStorage.getItem("sco-timeline-values"));
if(dates){
setPeriodValues(...dates);
}else{
setPeriodValues(t_start, t_start + period_default);
}
}
createTicks(); createTicks();
setPeriodValues(t_start, t_start + period_default); loadPeriodFromLocalStorage();
{% if heures %} {% if heures %}
let [heure_deb, heure_fin] = [{{ heures | safe }}] let [heure_deb, heure_fin] = [{{ heures | safe }}]