diff --git a/apis/hadithaApi.js b/apis/hadithaApi.js index c8c8d44..486f782 100644 --- a/apis/hadithaApi.js +++ b/apis/hadithaApi.js @@ -1,7 +1,7 @@ export default { search: { list: "repo/monir/search/@index_key/@search_type/@type_key/@listkey/@field_collapsed/@offset/@limit/@q=none", - show: "repo/public/get/byid/@index_key/@id", + show: "repo/public/get/byid/@index_key/@id/tbookmark", synonym: "synonym/get/words", prevNextHadith: "monir/next/@index_key/@vol_id/@parag_order/@step", getDataTree: "@appname/book/tree/@offset/@limit/@vol_id/@q" diff --git a/components/haditha/AutoComplation.vue b/components/haditha/AutoComplation.vue index 2eebabb..d8da47a 100644 --- a/components/haditha/AutoComplation.vue +++ b/components/haditha/AutoComplation.vue @@ -56,7 +56,7 @@ const search_type = ref("normal"); const type_key = ref("hadith"); const typeModelValue = ref("normal"); const typeModelValueFa = ref(""); -const showclearButton = ref(false); +// const showclearButton = ref(false); // If you want to share state across multiple components, // you can use the same key in useState. Nuxt will ensure @@ -168,17 +168,17 @@ const clearSimilar = () => { // const onUpdateModel = (newVal: boolean | InputMenuItem | any) => { // console.info("onUpdateModel", newVal); // }; -const searchButtonIcon = computed(() => { - return showclearButton.value ? "i-lucide-x" : "i-haditha-search"; -}); +// const searchButtonIcon = computed(() => { +// return showclearButton.value ? "i-lucide-x" : "i-haditha-search"; +// }); -const handleSearchClearButton = ()=>{ - showclearButton.value = true; - sendQuery(); -} +// const handleSearchClearButton = ()=>{ +// showclearButton.value = true; +// sendQuery(); +// } const onKeyDown = () => { - showclearButton.value = false; + // showclearButton.value = false; // clearTimeout(typingTimer.value); }; @@ -234,6 +234,12 @@ const sendQuery = async (payload = {}) => { return await httpService .postRequest(url, payload) .then((res) => { + emit("response-ready", { + res: res, + searchQuery: searchTerm.value, + disableAutoRedirect: true, + }); + // pass res and search query to the parent. loading.value = false; @@ -243,31 +249,29 @@ const sendQuery = async (payload = {}) => { // close the history dropdown menu open.value = false; - - // show clear button - if (showclearButton.value) { - searchTerm.value = ""; + // if (showclearButton.value) { + // searchTerm.value = ""; - emit("response-ready", { - res: { - hits:{ - total:0, - hits:[] - } - }, - searchQuery: searchTerm.value, - disableAutoRedirect: true, - }); - } else { - emit("response-ready", { - res: res, - searchQuery: searchTerm.value, - disableAutoRedirect: true, - }); - } - - showclearButton.value = !showclearButton.value; + // emit("response-ready", { + // res: { + // hits:{ + // total:0, + // hits:[] + // } + // }, + // searchQuery: searchTerm.value, + // disableAutoRedirect: true, + // }); + // } else { + // emit("response-ready", { + // res: res, + // searchQuery: searchTerm.value, + // disableAutoRedirect: true, + // }); + // } + + // showclearButton.value = !showclearButton.value; // store search phrase useStorage("searchPhrase", searchTerm.value); @@ -444,10 +448,10 @@ onMounted(() => { + @@ -605,7 +609,7 @@ onMounted(() => { {{ state.phrase.label }} diff --git a/components/haditha/CardList.vue b/components/haditha/CardList.vue index 11fade0..b156171 100644 --- a/components/haditha/CardList.vue +++ b/components/haditha/CardList.vue @@ -33,6 +33,7 @@ const goToLibraryShow = (item) => { { if (window?.outerWidth < 991) { isMobile.value = true; @@ -340,7 +343,7 @@ onMounted(() => { } } -@media screen and (max-width: 719.99px) { +@media screen and (max-width: 991.99px) { .fixed { .my-navbar { height: 4.8em; // 76px; diff --git a/components/haditha/search-page/SearchList.vue b/components/haditha/search-page/SearchList.vue index 0b047e8..5223b10 100644 --- a/components/haditha/search-page/SearchList.vue +++ b/components/haditha/search-page/SearchList.vue @@ -1,4 +1,6 @@