2014-01-30 09:41:04 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014
|
|
|
|
*
|
|
|
|
* This file is licensed under the Affero General Public License version 3
|
|
|
|
* or later.
|
|
|
|
*
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-02-26 09:16:54 +00:00
|
|
|
function switchPublicFolder() {
|
2012-03-19 10:56:02 +00:00
|
|
|
var publicEnable = $('#publicEnable').is(':checked');
|
2014-02-26 09:16:54 +00:00
|
|
|
// find all radiobuttons of that group
|
|
|
|
var sharingaimGroup = $('input:radio[name=sharingaim]');
|
2012-03-19 10:56:02 +00:00
|
|
|
$.each(sharingaimGroup, function(index, sharingaimItem) {
|
2014-02-26 09:16:54 +00:00
|
|
|
// set all buttons to the correct state
|
|
|
|
sharingaimItem.disabled = !publicEnable;
|
2012-03-19 10:56:02 +00:00
|
|
|
});
|
2011-07-09 19:44:50 +00:00
|
|
|
}
|
|
|
|
|
2014-02-26 09:16:54 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
// Execute the function after loading DOM tree
|
|
|
|
switchPublicFolder();
|
|
|
|
$('#publicEnable').click(function() {
|
|
|
|
// To get rid of onClick()
|
|
|
|
switchPublicFolder();
|
2012-03-19 10:56:02 +00:00
|
|
|
});
|
2011-07-09 19:44:50 +00:00
|
|
|
});
|