0.1.1 • Published 10 years ago
treeui v0.1.1
treeui
A simple collapsible tree ui, for file selectors and the like.
install
npm install --save treeuiexample
var treeui = require('treeui');
treeui(request)
.onclick(function(level) {
console.log(level);
})
.appendTo(document.body);
function request(tree, callback) {
callback(null, [1 + tree, 2 + tree, 3 + tree]);
}api
treeui(request)
Request is a function that takes (level, callback) and calls callback
with (err, results), where results is an array.
onclick(callback)
Call callback with the tree level of clicked items
appendTo(elem)
Append the UI to a given DOM element.