aboutsummaryrefslogtreecommitdiff
path: root/src/components/TimeLine.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2023-01-05 17:13:03 +1100
committerTerry Truong <terry06890@gmail.com>2023-01-05 17:23:39 +1100
commit442c0bbffc5c372c7ec3510914968f75ab6e4a4f (patch)
treebc3ae52ec3954ce574961bce9d64f2d02516d18b /src/components/TimeLine.vue
parenta3b13e700d8d65e27c1d90960b6ab6292e433c2c (diff)
Add partially-complete search modal
For now, use placeholder code for jumping to a search result. Add db index for case-insensitive event title searching. Make type=info requests accept title instead of ID (for looking up a searched-for title). Make EventInfo contain an Event field (for showing info in search suggestions). Add titleToEvent map in App, for use by SearchModal to look up searched-for titles. Add keyboard shortcuts to open/close search and info modals.
Diffstat (limited to 'src/components/TimeLine.vue')
-rw-r--r--src/components/TimeLine.vue9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue
index 277a263..e5fbf34 100644
--- a/src/components/TimeLine.vue
+++ b/src/components/TimeLine.vue
@@ -48,7 +48,7 @@
<div v-for="id in idToPos.keys()" :key="id" class="absolute animate-fadein z-20" :style="eventStyles(id)">
<!-- Image -->
<div class="rounded-full cursor-pointer hover:brightness-125" :style="eventImgStyles(id)"
- @click="onEventClick(id)"></div>
+ @click="emit('info-click', idToEvent.get(id)!.title)"></div>
<!-- Label -->
<div class="text-center text-stone-100 text-sm whitespace-nowrap text-ellipsis overflow-hidden">
{{idToEvent.get(id)!.title}}
@@ -96,7 +96,7 @@ const props = defineProps({
eventTree: {type: Object as PropType<RBTree<HistEvent>>, required: true},
unitCountMaps: {type: Object as PropType<Map<number, number>[]>, required: true},
});
-const emit = defineEmits(['close', 'state-chg', 'event-display', 'event-click']);
+const emit = defineEmits(['close', 'state-chg', 'event-display', 'info-click']);
// For size tracking
const width = ref(0);
@@ -1109,11 +1109,6 @@ watch(firstDate, onStateChg);
const skipTransition = ref(true);
onMounted(() => setTimeout(() => {skipTransition.value = false}, 100));
-// Click handling
-function onEventClick(eventId: number){
- emit('event-click', eventId);
-}
-
// Styles
const mainlineStyles = computed(() => {
return {