function hideNodeOrphans(items, index) {
            // If the parent is hidden, then the child is implicitly hidden
            var item = items[index];
            for (index++; index < items.length && items[index].depth > item.depth; ++index) {
                if (!items[index].$hidden) {