Skip to content

Commit

Permalink
Fix bug where removing the last subfolder did not hide toggle button …
Browse files Browse the repository at this point in the history
…on its parent record (#6007)
  • Loading branch information
alecpl committed Oct 20, 2017
1 parent eb62e15 commit c1d282e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------
Expand Down
9 changes: 8 additions & 1 deletion program/js/treelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit c1d282e

Please sign in to comment.