summaryrefslogtreecommitdiffstats
path: root/apps/files/js/admin.js
blob: 842b73c0caefa5b4d319aa83747909dc802ba5e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright (c) 2014
 *
 * This file is licensed under the Affero General Public License version 3
 * or later.
 *
 * See the COPYING-README file.
 *
 */

function switchPublicFolder() {
	var publicEnable = $('#publicEnable').is(':checked');
	// find all radiobuttons of that group
	var sharingaimGroup = $('input:radio[name=sharingaim]');
	$.each(sharingaimGroup, function(index, sharingaimItem) {
		// set all buttons to the correct state
		sharingaimItem.disabled = !publicEnable;
	});
}

$(document).ready(function() {
	// Execute the function after loading DOM tree
	switchPublicFolder();
	$('#publicEnable').click(function() {
		// To get rid of onClick()
		switchPublicFolder();
	});

	$('#allowZipDownload').bind('change', function() {
		if($('#allowZipDownload').attr('checked')) {
			$('#maxZipInputSize').removeAttr('disabled');
		} else {
			$('#maxZipInputSize').attr('disabled', 'disabled');
		}
	});
});