From 565e02d061001524658b0ff0c722e4eac0b657ba Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Sat, 5 May 2012 17:09:32 -0400 Subject: [PATCH] Add back removed groups to the select form correctly --- apps/files_sharing/js/share.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 65118f5e85..e9b46873d3 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -161,11 +161,17 @@ OC.Share={ }, removeSharedWith:function(uid_shared_with) { - $('#sharedWithList li[data-uid_shared_with="'+uid_shared_with+'"]').remove(); - if ($('#groupList li').length < 1) { - $('#groups').hide(); + var option; + if ($('#userList li[data-uid_shared_with="'+uid_shared_with+'"]').length > 0) { + $('#userList li[data-uid_shared_with="'+uid_shared_with+'"]').remove(); + option = ''; + } else if ($('#groupList li[data-uid_shared_with="'+uid_shared_with+'"]').length > 0) { + $('#groupList li[data-uid_shared_with="'+uid_shared_with+'"]').remove(); + if ($('#groupList li').length < 1) { + $('#groups').hide(); + } + option = ''; } - var option = ''; $(option).appendTo('#share_with'); $('#share_with').trigger('liszt:updated'); },