]> source.dussan.org Git - nextcloud-server.git/commitdiff
use .filterAttr()
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 9 Jul 2014 14:52:52 +0000 (16:52 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 9 Jul 2014 14:52:52 +0000 (16:52 +0200)
settings/js/users/users.js

index 97f3a960a6e537f0370d16102c664e2595165643..7d567e225d9f3423437c7b7b65b8c2f352ed96f9 100644 (file)
@@ -73,8 +73,8 @@ var UserList = {
                                .find('option').attr('selected', null)
                                .first().attr('selected', 'selected');
                } else {
-                       if ($quotaSelect.find('option[value="' + quota + '"]').length > 0) {
-                               $quotaSelect.find('option[value="' + quota + '"]').attr('selected', 'selected');
+                       if ($quotaSelect.find('option').filterAttr('value', quota).length > 0) {
+                               $quotaSelect.find('option').filterAttr('value', quota).attr('selected', 'selected');
                        } else {
                                $quotaSelect.append('<option value="' + escapeHTML(quota) + '" selected="selected">' + escapeHTML(quota) + '</option>');
                        }
@@ -414,7 +414,7 @@ var UserList = {
                var addGroup = function (select, group) {
                        $('select[multiple]').each(function (index, element) {
                                $element = $(element);
-                               if ($element.find('option[value="' + group + '"]').length === 0 &&
+                               if ($element.find('option').filterAttr('value', group).length === 0 &&
                                        select.data('msid') !== $element.data('msid')) {
                                        $element.append('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>');
                                }
@@ -464,7 +464,7 @@ var UserList = {
 
                var addSubAdmin = function (group) {
                        $('select[multiple]').each(function (index, element) {
-                               if ($(element).find('option[value="' + group + '"]').length === 0) {
+                               if ($(element).find('option').filterAttr('value', group).length === 0) {
                                        $(element).append('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>');
                                }
                        });