diff --git a/CHANGELOG b/CHANGELOG index c81e5cbfc6a..2d83bd88f00 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -62,6 +62,7 @@ CHANGELOG Roundcube Webmail - Fix Edge encoding bug when pasting text into the HTML editor, update to TinyMCE 4.5.8 (#5885) - Fix handling of unknown Content-Disposition type (#6002) - Fix truncated folder name on messages list in multi-folder mode, for folders with non-ascii characters (#6004) +- Fix bug where removing the last subfolder did not hide toggle button on its parent record (#6007) RELEASE 1.3.1 ------------- diff --git a/program/js/treelist.js b/program/js/treelist.js index 2f70e84ff63..ef486d16fc6 100644 --- a/program/js/treelist.js +++ b/program/js/treelist.js @@ -464,10 +464,11 @@ function rcube_treelist_widget(node, p) */ function remove(id) { - var node, li; + var node, li, parent; if (node = indexbyid[id]) { li = id2dom(id, true); + parent = li.parent(); li.remove(); node.deleted = true; @@ -477,6 +478,12 @@ function rcube_treelist_widget(node, p) id2dom(id, false).remove(); } + // remove tree-toggle button and children list + if (!parent.children().length) { + parent.parent().find('div.treetoggle').remove(); + parent.remove(); + } + return true; }