]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent duplicate group showing in multiselect that added the group
authorMichael Gapczynski <mtgap@owncloud.com>
Fri, 29 Jun 2012 21:52:24 +0000 (17:52 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Sun, 1 Jul 2012 15:36:57 +0000 (11:36 -0400)
settings/js/users.js

index 020aff885e375df0a33cd93b702b8914639ea10b..784f8b888cb66ff52d5c6e387367948d2644f0fa 100644 (file)
@@ -42,7 +42,9 @@ $(document).ready(function(){
                }
                var addGroup = function(group) {
                        $('select[multiple]').each(function(index, element) {
-                               $(element).append('<option value="'+group+'">'+group+'</option>');
+                               if ($(element).find('option[value="'+group +'"]').length == 0) {
+                                       $(element).append('<option value="'+group+'">'+group+'</option>');
+                               }
                        })
                };
                element.multiSelect({