Merge pull request #2139 from sevannerse/fix-livewire-search

Prevents making unnecessary requests for global search
This commit is contained in:
Cüneyt Şentürk 2021-06-25 14:00:45 +03:00 committed by GitHub
commit 78d27fa9cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,9 @@
@push('scripts_end') @push('scripts_end')
<script type="text/javascript"> <script type="text/javascript">
$(window).click(function() { $(window).click(function() {
if (Livewire.components.getComponentsByName('common.search')[0].data.results.length > 0) {
Livewire.emit('resetKeyword'); Livewire.emit('resetKeyword');
}
}); });
</script> </script>
@endpush @endpush