diff --git a/public/css/app.css b/public/css/app.css index 17c504e04..f9dff92a9 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -47449,6 +47449,10 @@ body{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } +.hover\:rounded-lg:hover{ + border-radius: 0.5rem; +} + .hover\:bg-gray-100:hover{ --tw-bg-opacity: 1; background-color: rgb(243 244 246 / var(--tw-bg-opacity)); diff --git a/resources/assets/js/views/modules/apps.js b/resources/assets/js/views/modules/apps.js index 12ff89136..4cafe1a30 100644 --- a/resources/assets/js/views/modules/apps.js +++ b/resources/assets/js/views/modules/apps.js @@ -29,6 +29,10 @@ const app = new Vue({ AkauntingSlider }, + created() { + document.addEventListener('click', this.closeIfClickedOutside); + }, + mounted() { if (typeof app_slug !== 'undefined') { this.onReleases(1); @@ -84,6 +88,9 @@ const app = new Vue({ addToCartLoading: false, loadMoreLoading: false, + live_search_modal: false, + live_search_data: [], + route_url: url } }, @@ -288,5 +295,32 @@ const app = new Vue({ this.loadMoreLoading = false; }); }, + + closeIfClickedOutside(event) { + let el = this.$refs.liveSearchModal; + let target = event.target; + + if (el !== target && target.contains(el)) { + this.live_search_modal = false; + } + }, + + onLiveSearch(event) { + let target_length = event.target.value.length; + + if (target_length > 2) { + window.axios.get(url + '/apps/paid') + .then(response => { + this.live_search_data = response.data.data.data; + this.live_search_modal = true; + }) + .catch(error => { + this.live_search_modal = false; + console.log(error); + }) + } else if (target_length == 0) { + this.live_search_modal = false; + } + } } }); diff --git a/resources/views/components/layouts/modules/bar.blade.php b/resources/views/components/layouts/modules/bar.blade.php index b5ba09a00..0dd6c21af 100644 --- a/resources/views/components/layouts/modules/bar.blade.php +++ b/resources/views/components/layouts/modules/bar.blade.php @@ -73,6 +73,7 @@ value="{{ isset($keyword) ? $keyword : '' }}" placeholder="{{ trans('general.search_placeholder') }}" autocomplete="off" + v-on:keyup="onLiveSearch($event)" /> @@ -104,4 +105,22 @@ - + +
+ +
+ \ No newline at end of file