This repository was archived by the owner on Mar 16, 2022. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,16 @@ module.exports = {
33  setOptions : setOptions 
44} 
55
6- var  opt  =  { } 
7- opt . templatePattern  =  / \{ ( .* ?) \} / g
6+ var  options  =  { } 
7+ options . templatePattern  =  / \{ ( .* ?) \} / g
88
9- function  setOptions ( _opt ) { 
10-   opt  =  _opt  ||  { } 
11-   opt . templatePattern  =  _opt . templatePattern  ||  / \{ ( .* ?) \} / g
9+ function  setOptions ( _options ) { 
10+   options  =  _options  ||  { } 
11+   options . templatePattern  =  _options . templatePattern  ||  / \{ ( .* ?) \} / g
1212} 
1313
14- function  compile ( t ,  data ) { 
15-   return  t . replace ( opt . templatePattern ,  function ( match ,  prop )  { 
14+ function  compile ( template ,  data ) { 
15+   return  template . replace ( options . templatePattern ,  function ( match ,  prop )  { 
1616    return  data [ prop ]  ||  match 
1717  } ) 
1818} 
Original file line number Diff line number Diff line change 7272
7373  function  registerInput ( ) { 
7474    options . searchInput . addEventListener ( 'keyup' ,  function ( e ) { 
75-       if (   e . target . value . length   ==   0   ) { 
76-          emptyResultsContainer ( ) 
77-         return 
75+       emptyResultsContainer ( ) 
76+       if (   e . target . value . length   >   0   ) { 
77+         render (   repository . search ( e . target . value )   ) 
7878      } 
79-       render (  repository . search ( e . target . value )  ) 
8079    } ) 
8180  } 
8281
8382  function  render ( results ) { 
84-     emptyResultsContainer ( ) 
8583    if (  results . length  ==  0  ) { 
8684      return  appendToResultsContainer ( options . noResultsText ) 
8785    } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments