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);
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;
}
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) {
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('|');
});
$(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) {
<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>
<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}}