diff --git a/CHANGELOG b/CHANGELOG index 05cd34d13..113300a2a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,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 2f70e84ff..ef486d16f 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; }