aboutsummaryrefslogtreecommitdiff
path: root/src/components/TimeLine.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/TimeLine.vue')
-rw-r--r--src/components/TimeLine.vue6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue
index 7d37ca8..413c163 100644
--- a/src/components/TimeLine.vue
+++ b/src/components/TimeLine.vue
@@ -172,6 +172,7 @@ function initScale(){ // Initialises to smallest usable scale
}
}
}
+ onStateChg();
}
function getYearlyScale(startDate: HistDate, endDate: HistDate, availLen: number){
// Get the smallest yearly scale that divides a date range, without making ticks too close
@@ -905,11 +906,12 @@ function onShiftWheel(evt: WheelEvent){
}
// For bound-change signalling
-watch(startDate, () => {
+function onStateChg(){
emit('state-chg', new TimelineState(
ID, startDate.value, endDate.value, startOffset.value, endOffset.value, scaleIdx.value
));
-});
+}
+watch(startDate, onStateChg);
// For skipping transitions on startup (and on horz/vert swap)
const skipTransition = ref(true);