UNPKG

selecton

Version:

Selecton.js combines a searchbar and a dropdown menu with nested child lists.

15 lines (12 loc) 421 B
import {_getDropdownListitems} from './elementHandler'; export default function(w, p, key){ openAllParents(w, p, key); } function openAllParents(w, p, key){ if(p !== 'root'){ var f = _getDropdownListitems(w).filter(function(d){ return key(d) === p; }).data()[0]; f.closed = false; f.children.forEach(function(d){ d.closed = false; }); openAllParents(w, f._parent_, key); } }