aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2023-01-16 00:34:36 +1100
committerTerry Truong <terry06890@gmail.com>2023-01-16 00:34:36 +1100
commit1b14b45ac494c090037eb4c5f92321d1aebc59da (patch)
treedacf05e3e496e7e17f72fe633f24f517f2c33562 /src/components
parent3e40591c87ad8dab0447408d2de7b41ab98a4f4d (diff)
Make title clicks reset timelines
Diffstat (limited to 'src/components')
-rw-r--r--src/components/TimeLine.vue10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue
index f1188cc..56136fd 100644
--- a/src/components/TimeLine.vue
+++ b/src/components/TimeLine.vue
@@ -102,6 +102,7 @@ const props = defineProps({
unitCountMaps: {type: Object as PropType<Map<number, number>[]>, required: true},
current: {type: Boolean, required: true},
searchTarget: {type: Object as PropType<[null | HistEvent, boolean]>, required: true},
+ reset: {type: Boolean, required: true},
});
const emit = defineEmits(['close', 'state-chg', 'event-display', 'info-click']);
@@ -1256,6 +1257,15 @@ watch(idToEvent, () => { // Remove highlighting of search results that have beco
}
});
+// For resets
+watch(() => props.reset, () => {
+ startDate.value = store.initialStartDate;
+ endDate.value = store.initialEndDate;
+ startOffset.value = store.defaultEndTickOffset;
+ endOffset.value = store.defaultEndTickOffset;
+ initScale();
+});
+
// For keyboard shortcuts
function onKeyDown(evt: KeyboardEvent){
if (!props.current || store.disableShortcuts){