Merge pull request #4973 from nextcloud/stable12-4972

Fix group restriction regression
This commit is contained in:
Lukas Reschke 2017-05-19 21:46:14 +02:00 committed by GitHub
commit e0277fa9b7
2 changed files with 9 additions and 9 deletions

View 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) {

View 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}}