From fa34e5ebcd1ca116a91204e6d4c74a9f29ea79fc Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 24 Nov 2019 08:15:48 +0100 Subject: [PATCH] Fix bug where a new saved search added after removing all searches wasn't added to the list (#7061) --- CHANGELOG | 1 + program/js/treelist.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index aff783ad1..fef9ed110 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ CHANGELOG Roundcube Webmail - Fix unread count after purge on a folder that is not currently selected (#7051) - Fix bug where Enter key didn't work on messages list in "List" layout (#7052) - Fix bug where deleting a saved search in addressbook caused display issue on sources/groups list (#7061) +- Fix bug where a new saved search added after removing all searches wasn't added to the list (#7061) - Fix bug where a new contact group added after removing all groups from addressbook wasn't added to the list - Fix bug where Ctype extension wasn't required in Installer and INSTALL file (#7049) diff --git a/program/js/treelist.js b/program/js/treelist.js index 7eef31c79..32549fd26 100644 --- a/program/js/treelist.js +++ b/program/js/treelist.js @@ -526,7 +526,11 @@ function rcube_treelist_widget(node, p) // remove tree-toggle button and children list if (!parent.children().length) { parent.parent('li').find('div.treetoggle').remove(); - parent.remove(); + + // remove parent, but not if it's the list itself + if (parent[0] != container[0]) { + parent.remove(); + } } return true;