From 5c671c995cfb68866608e95b28e5be49087eb910 Mon Sep 17 00:00:00 2001 From: Hans Bakker Date: Sat, 9 Jul 2011 21:44:50 +0200 Subject: [PATCH] finish refactoring of files admin page --- files/js/admin.js | 15 +++++++++++++++ files/templates/admin.php | 16 ++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 files/js/admin.js diff --git a/files/js/admin.js b/files/js/admin.js new file mode 100644 index 00000000000..5cbb2b9f5ac --- /dev/null +++ b/files/js/admin.js @@ -0,0 +1,15 @@ +function switchPublicFolder() +{ + var publicEnable = $('#publicEnable').is(':checked'); + var sharingaimGroup = $('input:radio[name=sharingaim]'); //find all radiobuttons of that group + $.each(sharingaimGroup, function(index, sharingaimItem) { + sharingaimItem.disabled = !publicEnable; //set all buttons to the correct state + }); +} + +$(document).ready(function(){ + switchPublicFolder(); // Execute the function after loading DOM tree + $('#publicEnable').click(function(){ + switchPublicFolder(); // To get rid of onClick() + }); +}); diff --git a/files/templates/admin.php b/files/templates/admin.php index 9564076501c..ff331f860e6 100644 --- a/files/templates/admin.php +++ b/files/templates/admin.php @@ -1,21 +1,13 @@ - + +
'/>
-
+
-
+