admin.js 699 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2014
  3. *
  4. * This file is licensed under the Affero General Public License version 3
  5. * or later.
  6. *
  7. * See the COPYING-README file.
  8. *
  9. */
  10. function switchPublicFolder() {
  11. var publicEnable = $('#publicEnable').is(':checked');
  12. // find all radiobuttons of that group
  13. var sharingaimGroup = $('input:radio[name=sharingaim]');
  14. $.each(sharingaimGroup, function(index, sharingaimItem) {
  15. // set all buttons to the correct state
  16. sharingaimItem.disabled = !publicEnable;
  17. });
  18. }
  19. $(document).ready(function() {
  20. // Execute the function after loading DOM tree
  21. switchPublicFolder();
  22. $('#publicEnable').click(function() {
  23. // To get rid of onClick()
  24. switchPublicFolder();
  25. });
  26. });