diff options
Diffstat (limited to 'program/js/treelist.js')
-rw-r--r-- | program/js/treelist.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/program/js/treelist.js b/program/js/treelist.js index a7cd7cd43..c034f77b8 100644 --- a/program/js/treelist.js +++ b/program/js/treelist.js @@ -458,6 +458,10 @@ function rcube_treelist_widget(node, p) node.deleted = true; delete indexbyid[id]; + if (search_active) { + id2dom(id, false).remove(); + } + return true; } @@ -477,7 +481,7 @@ function rcube_treelist_widget(node, p) */ function update_dom(node) { - var li = id2dom(node.id); + var li = id2dom(node.id, true); li.attr('aria-expanded', node.collapsed ? 'false' : 'true'); li.children('ul').first()[(node.collapsed ? 'hide' : 'show')](); li.children('div.treetoggle').removeClass('collapsed expanded').addClass(node.collapsed ? 'collapsed' : 'expanded'); @@ -698,7 +702,8 @@ function rcube_treelist_widget(node, p) node.childlistclass = sublist.attr('class'); } if (node.children.length) { - node.collapsed = sublist.css('display') == 'none'; + if (node.collapsed === undefined) + node.collapsed = sublist.css('display') == 'none'; // apply saved state state = get_state(node.id, node.collapsed); |