summaryrefslogtreecommitdiffstats
path: root/files/js
diff options
context:
space:
mode:
Diffstat (limited to 'files/js')
-rw-r--r--files/js/admin.js15
-rw-r--r--files/js/files.js4
2 files changed, 17 insertions, 2 deletions
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/js/files.js b/files/js/files.js
index 431b49131ce..3c02110fe26 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -39,7 +39,7 @@ $(document).ready(function() {
// Sets the file link behaviour :
$('td.filename a').live('click',function(event) {
event.preventDefault();
- var filename=$(this).text();
+ var filename=$(this).parent().parent().attr('data-file');
var mime=$(this).parent().parent().attr('data-mime');
var type=$(this).parent().parent().attr('data-type');
var action=FileActions.getDefault(mime,type);
@@ -245,7 +245,7 @@ function formatDate(date){
//options for file drag/dropp
var dragOptions={
- distance: 20, revert: true, opacity: 0.7,
+ distance: 20, revert: 'invalid', opacity: 0.7,
stop: function(event, ui) {
$('#fileList tr td.filename').addClass('ui-draggable');
}