Blame view

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