Browse Source

class Searcher extends Events

Simon Legner 1 year ago
parent
commit
b6a5e388f5
1 changed files with 4 additions and 5 deletions
  1. 4 5
      assets/javascripts/app/searcher.js

+ 4 - 5
assets/javascripts/app/searcher.js

@@ -172,10 +172,8 @@ function scoreFuzzyMatch() {
   let EMPTY_STRING = undefined;
   let EMPTY_STRING = undefined;
   let ELLIPSIS = undefined;
   let ELLIPSIS = undefined;
   let STRING = undefined;
   let STRING = undefined;
-  app.Searcher = class Searcher {
+  app.Searcher = class Searcher extends Events {
     static initClass() {
     static initClass() {
-      $.extend(this.prototype, Events);
-
       CHUNK_SIZE = 20000;
       CHUNK_SIZE = 20000;
 
 
       DEFAULTS = {
       DEFAULTS = {
@@ -215,6 +213,7 @@ function scoreFuzzyMatch() {
     }
     }
 
 
     constructor(options) {
     constructor(options) {
+      super();
       this.options = $.extend({}, DEFAULTS, options || {});
       this.options = $.extend({}, DEFAULTS, options || {});
     }
     }
 
 
@@ -397,11 +396,11 @@ function scoreFuzzyMatch() {
         var char = chars[i];
         var char = chars[i];
         chars[i] = $.escapeRegexp(char);
         chars[i] = $.escapeRegexp(char);
       }
       }
-      return new RegExp(chars.join(".*?"));
+      return new RegExp(chars.join(".*?")); // abc -> /a.*?b.*?c.*?/
     }
     }
   };
   };
   app.Searcher.initClass();
   app.Searcher.initClass();
-  return app.Searcher; // abc -> /a.*?b.*?c.*?/
+  return app.Searcher;
 })();
 })();
 
 
 app.SynchronousSearcher = class SynchronousSearcher extends app.Searcher {
 app.SynchronousSearcher = class SynchronousSearcher extends app.Searcher {