Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-05-20 11:15:07 +0300
committerVincent Petry <pvince81@owncloud.com>2016-05-20 18:56:02 +0300
commit79f6b7b7ff2aa606e08255287c25fe168f710f44 (patch)
tree48bb3dca5ab15f321bafb7e3f5009d9646417f11 /settings
parent8fbb63d3166378ca63d6d0e6d21fa08d8d8be268 (diff)
Make it possible to exclude admin groups from groups select2
Diffstat (limited to 'settings')
-rw-r--r--settings/js/settings.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/settings/js/settings.js b/settings/js/settings.js
index fcbe328b76f..5a2ba4bcec7 100644
--- a/settings/js/settings.js
+++ b/settings/js/settings.js
@@ -16,10 +16,13 @@ OC.Settings = _.extend(OC.Settings, {
* for groups)
*
* @param $elements jQuery element (hidden input) to setup select2 on
- * @param [extraOptions] extra options hash to pass to select2
+ * @param {Array} [extraOptions] extra options hash to pass to select2
+ * @param {Array} [options] extra options
+ * @param {Array} [options.excludeAdmins=false] flag whether to exclude admin groups
*/
- setupGroupsSelect: function($elements, extraOptions) {
+ setupGroupsSelect: function($elements, extraOptions, options) {
var self = this;
+ options = options || {};
if ($elements.length > 0) {
// note: settings are saved through a "change" event registered
// on all input fields
@@ -48,9 +51,11 @@ OC.Settings = _.extend(OC.Settings, {
var results = [];
// add groups
- $.each(data.data.adminGroups, function(i, group) {
- results.push({id:group.id, displayname:group.name});
- });
+ if (!options.excludeAdmins) {
+ $.each(data.data.adminGroups, function(i, group) {
+ results.push({id:group.id, displayname:group.name});
+ });
+ }
$.each(data.data.groups, function(i, group) {
results.push({id:group.id, displayname:group.name});
});