]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add back removed groups to the select form correctly
authorMichael Gapczynski <GapczynskiM@gmail.com>
Sat, 5 May 2012 21:09:32 +0000 (17:09 -0400)
committerMichael Gapczynski <GapczynskiM@gmail.com>
Sat, 5 May 2012 21:10:07 +0000 (17:10 -0400)
apps/files_sharing/js/share.js

index 65118f5e85c68146c24c4c77ec54cc486d4f2368..e9b46873d3a6f8b240cf6d34970551a7858c3b73 100644 (file)
@@ -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 = '<option value="'+uid_shared_with+'">'+uid_shared_with+'</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 = '<option value="'+uid_shared_with+'(group)">'+uid_shared_with+' (group)</option>';
                }
-               var option = '<option value="'+uid_shared_with+'">'+uid_shared_with+'</option>';
                $(option).appendTo('#share_with');
                $('#share_with').trigger('liszt:updated');
        },