]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/entity-search.js
Refactor notify exception to clean up api exception handling
[bookstack] / resources / js / components / entity-search.js
index 8b1861ecf6afec1eb66e9d46843e34561471efc5..7a50444708dee6313ab5b2caee5a2dd21def7cdb 100644 (file)
@@ -1,10 +1,8 @@
-import {onSelect} from "../services/dom";
+import {onSelect} from '../services/dom';
+import {Component} from './component';
+
+export class EntitySearch extends Component {
 
-/**
- * Class EntitySearch
- * @extends {Component}
- */
-class EntitySearch {
     setup() {
         this.entityId = this.$opts.entityId;
         this.entityType = this.$opts.entityType;
@@ -33,7 +31,8 @@ class EntitySearch {
     runSearch() {
         const term = this.searchInput.value.trim();
         if (term.length === 0) {
-            return this.clearSearch();
+            this.clearSearch();
+            return;
         }
 
         this.searchView.classList.remove('hidden');
@@ -54,6 +53,5 @@ class EntitySearch {
         this.loadingBlock.classList.add('hidden');
         this.searchInput.value = '';
     }
-}
 
-export default EntitySearch;
\ No newline at end of file
+}