From 3b20b6ce0038ddb25e06ecc5103d77e19e23e1c1 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Mon, 16 Jan 2023 10:45:13 +1100 Subject: Add loading indicator --- src/components/LoadingModal.vue | 27 +++++++++++++++++++++++++++ src/components/SearchModal.vue | 4 +++- src/components/icon/LoaderIcon.vue | 13 +++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/components/LoadingModal.vue create mode 100644 src/components/icon/LoaderIcon.vue (limited to 'src/components') diff --git a/src/components/LoadingModal.vue b/src/components/LoadingModal.vue new file mode 100644 index 0000000..5d207c7 --- /dev/null +++ b/src/components/LoadingModal.vue @@ -0,0 +1,27 @@ + + + diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue index ade86be..be8df51 100644 --- a/src/components/SearchModal.vue +++ b/src/components/SearchModal.vue @@ -47,7 +47,7 @@ const props = defineProps({ eventTree: {type: Object as PropType>, required: true}, titleToEvent: {type: Object as PropType>, required: true}, }); -const emit = defineEmits(['search', 'close', 'info-click']); +const emit = defineEmits(['search', 'close', 'info-click', 'net-wait', 'net-get']); // Search-suggestion data const searchSuggs = ref([] as string[]); @@ -179,7 +179,9 @@ async function resolveSearch(eventTitle: string){ if (store.reqImgs){ urlParams.append('imgonly', 'true'); } + emit('net-wait'); // Allows the parent component to show a loading-indicator let responseObj: EventInfoJson | null = await queryServer(urlParams); + emit('net-get'); if (responseObj != null){ let eventInfo = jsonToEventInfo(responseObj); if (store.reqImgs && eventInfo.event.imgId == null){ diff --git a/src/components/icon/LoaderIcon.vue b/src/components/icon/LoaderIcon.vue new file mode 100644 index 0000000..c2a0369 --- /dev/null +++ b/src/components/icon/LoaderIcon.vue @@ -0,0 +1,13 @@ + -- cgit v1.2.3