]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix group restriction regression 4973/head
authorMorris Jobke <hey@morrisjobke.de>
Fri, 19 May 2017 17:05:09 +0000 (12:05 -0500)
committerMorris Jobke <hey@morrisjobke.de>
Fri, 19 May 2017 17:09:49 +0000 (12:09 -0500)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
settings/js/apps.js
settings/templates/apps.php

index 6bad2cc842c33a38e0183a72db692ff2844cb757..957ad395f94a2cbfac17fa2e49f0e961f9642e19 100644 (file)
@@ -259,10 +259,10 @@ OC.Settings.Apps = OC.Settings.Apps || {
                        page.find(".groups-enable").hide();
                        page.find(".groups-enable__checkbox").prop('checked', false);
                } else {
-                       page.find('#group_select').val((app.groups || []).join('|'));
+                       page.find('.group_select').val((app.groups || []).join('|'));
                        if (app.active) {
                                if (app.groups.length) {
-                                       OC.Settings.Apps.setupGroupsSelect(page.find('#group_select'));
+                                       OC.Settings.Apps.setupGroupsSelect(page.find('.group_select'));
                                        page.find(".groups-enable__checkbox").prop('checked', true);
                                } else {
                                        page.find(".groups-enable__checkbox").prop('checked', false);
@@ -390,7 +390,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
                                        elements.forEach(function(element) {
                                                element.val(t('settings', 'Enable'));
                                                element.parent().find(".groups-enable").hide();
-                                               element.parent().find('#group_select').hide().val(null);
+                                               element.parent().find('.group_select').hide().val(null);
                                        });
                                        OC.Settings.Apps.State.apps[appId].active = false;
                                }
@@ -458,7 +458,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
                                                        elements.forEach(function(element) {
                                                                element.parent().find(".groups-enable").prop('checked', true);
                                                                element.parent().find(".groups-enable").hide();
-                                                               element.parent().find('#group_select').hide().val(null);
+                                                               element.parent().find('.group_select').hide().val(null);
                                                        });
                                                } else {
                                                        elements.forEach(function(element) {
@@ -905,8 +905,8 @@ OC.Settings.Apps = OC.Settings.Apps || {
                        OC.Settings.Apps.updateApp(appId, element);
                });
 
-               $(document).on('change', '#group_select', function() {
-                       var element = $(this).parent().find('input.enable');
+               $(document).on('change', '.group_select', function() {
+                       var element = $(this).closest('.section').find('input.enable');
                        var groups = $(this).val();
                        if (groups && groups !== '') {
                                groups = groups.split('|');
@@ -922,7 +922,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
                });
 
                $(document).on('change', ".groups-enable__checkbox", function() {
-                       var $select = $(this).closest('.section').find('#group_select');
+                       var $select = $(this).closest('.section').find('.group_select');
                        $select.val('');
 
                        if (this.checked) {
index 260b042c078d872141f70a4b107b20dae6c8077a..e32a524f78af494282b40945e362933f7d5c322d 100644 (file)
@@ -59,7 +59,7 @@ script(
                <div class="groups-enable">
                        <input type="checkbox" class="groups-enable__checkbox checkbox" id="groups_enable-{{id}}"/>
                        <label for="groups_enable-{{id}}"><?php p($l->t('Limit to groups')); ?></label>
-                       <input type="hidden" id="group_select" title="<?php p($l->t('All')); ?>">
+                       <input type="hidden" class="group_select" title="<?php p($l->t('All')); ?>">
                </div>
                {{/if}}
        </div>
@@ -182,7 +182,7 @@ script(
                <input type="checkbox" class="groups-enable__checkbox checkbox" id="groups_enable-{{id}}"/>
                <label for="groups_enable-{{id}}"><?php p($l->t('Enable only for specific groups')); ?></label>
        </div>
-       <input type="hidden" id="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px">
+       <input type="hidden" class="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px">
        {{else}}
        <input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable"));?>"/>
        {{/if}}