docs: function detree(items, children, parent_id) {
  
  		var item,
  		    i;
  
  		for (i = 0; i < children.length; i++) {
  
  			item = children[i];
  
  			if (parent_id) {
  				item.parent = parent_id;
  			}
  
  			items.push(item);
  
  			if (item.children) {
  				detree(items, item.children, item.id);
  			}
  
  			delete item.children;
  		}
  	}