push
This commit is contained in:
@@ -74,7 +74,7 @@ clay_input.click = function click(tree_root, mousepos, button = 'left') {
|
||||
clay_input.get_actionable = function get_actionable(tree_root) {
|
||||
var actionable = []
|
||||
function walk(node) {
|
||||
if (node.config.action) actionable.push(node)
|
||||
if (node.config.action) push(actionable, node)
|
||||
if (node[clay.CHILDREN])
|
||||
arrfor(node[clay.CHILDREN], walk)
|
||||
}
|
||||
@@ -85,7 +85,7 @@ clay_input.get_actionable = function get_actionable(tree_root) {
|
||||
clay_input.filter = function filter(tree_root, predicate) {
|
||||
var results = []
|
||||
function rec(node) {
|
||||
if (predicate(node)) results.push(node)
|
||||
if (predicate(node)) push(results, node)
|
||||
if (node[clay.CHILDREN])
|
||||
arrfor(node[clay.CHILDREN], rec)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user