]> _ Git - odl.git/commitdiff
wip #5120 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Feb 2022 14:53:53 +0000 (15:53 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Feb 2022 14:53:53 +0000 (15:53 +0100)
resources/js/search.js
resources/views/components/search.blade.php

index a881dba3b0e9ebdbb2c94e5799e179b611addb5d..ef52c559f3f774f871479bc08fa351c317fb5046 100644 (file)
@@ -14,8 +14,7 @@ export default () => ({
             prefix: true, // Allow partial matches
             processTerm: (term, _fieldName) => term.length < 3 ? null : term.toLowerCase()
         },
-    },
-    query: '', // The search query
+    }, query: '', // The search query
     medialibrary: '', // Holds URL of the media library that is passed in from the component
 
     async init() {
@@ -55,10 +54,11 @@ export default () => ({
             return [];
         }
 
-        // console.log(`search results: ${this.query}`);
-        // console.table(this.miniSearch.search(this.query))
+        return this.miniSearch.search(this.query);
+    },
 
-        return this.miniSearch.search(this.query)
+    get showResults() {
+        return false;
     },
 
     get resultCount() {
index bffa838550e5d5d33c97e667de039c74f68ec5a9..5c8b45c3db47369d289cfe1a3e7f669d0eda2834 100644 (file)
@@ -63,7 +63,7 @@
          x-show="searchOpen"
          x-transition:enter.opacity.duration.500ms.delay.1500ms
          x-transition:leave.opacity.delay.50ms>
-        <div x-show="query !== ''" class="font-secondary font-medium">
+        <div x-show="showResults" class="font-secondary font-medium">
             <p x-text="resultCount" class="mt-15 opacity-50"></p>
 
             <div class="h-full max-h-full overflow-y-auto">