Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

yields/search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

search

list input search.

Installation

Install with component(1):

$ component install yields/search

Example

var input = query('input');
var one = query('ul.one');
var two = query('ul.two');
var search = new InputSearch(input);

// add lists

search
.add(one)
.add(two);

API

SearchInput(el)

Initialize SearchInput with <input>.

.bind()

Bind internal events.

.unbind()

Unbind internal events.

.add(NodeList|Element)

Add a NodeList or Element that has .children to search in.

.cache()

Cache elements, the method is called after you add Element or NodeList.

.use(fn)

Change the algorithm to fn(str, term), by default a naive index(str, term) is used.

.match(term)

Search term, the method will use fn(str, term) to add / remove .hide or .show classes.

License

MIT

About

search. input => list.

Resources

Stars

Watchers

Forks

Packages

No packages published