diff --git a/files/css/files.css b/files/css/files.css index 771e66fed64..806582da213 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -23,6 +23,11 @@ display: none; } +#file_upload_form input[type="button"]{ + /* this is a dirty wurgaround, Jan needs to fix it in global css*/ + font-size: 0.9em; +} + #file_newfolder_form { display: none; } diff --git a/files/js/files.js b/files/js/files.js index f1cb200817b..edb57fc2c0e 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -74,6 +74,12 @@ $(document).ready(function() { $('#file_upload_target').load(uploadFinished); }); + $('#file_upload_cancel').click(function() { + $('#file_action_panel').attr('activeAction', 'false'); + $('#file_upload_form').hide(); + $('p.actions a.upload:first').show(); + }); + $('#file_new_dir_submit').click(function() { $.ajax({ url: 'ajax/newfolder.php', @@ -86,8 +92,16 @@ $(document).ready(function() { if($('#file_action_panel').attr('activeAction') != 'upload') { $('#file_action_panel').attr('activeAction', 'upload'); $('#fileSelector').replaceWith(''); + $('#fileSelector').change(function() { + $('#file_upload_start').val('Upload ' + $('#fileSelector').val()); + $('p.actions a.upload:first').after($('#file_upload_form')); + $('#file_upload_form').css('display', 'inline'); + $('p.actions a.upload:first').hide(); + $('#fileSelector').hide(); + }); $('#file_action_panel form').slideUp(250); - $('#file_upload_form').slideDown(250); +// $('#file_upload_form').slideDown(250); + $('#fileSelector').click(); } else { $('#file_action_panel').attr('activeAction', 'false'); $('#file_upload_form').slideUp(250); @@ -95,6 +109,8 @@ $(document).ready(function() { return false; }); + + $('.new-dir').click(function(){ if($('#file_action_panel').attr('activeAction') != 'new-dir') { $('#file_action_panel').attr('activeAction', 'new-dir'); @@ -151,7 +167,12 @@ function uploadFinished() { $.ajax({ url: 'ajax/list.php', data: "dir="+dir, - complete: refreshContents + complete: function(data) { + refreshContents(data); + $('#file_action_panel').prepend($('#file_upload_form')); + $('#file_upload_form').css('display', 'block').hide(); + $('p.actions a.upload:first').show(); + } }); } } diff --git a/files/templates/index.php b/files/templates/index.php index f761f1f538d..54de41c594a 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -1,6 +1,6 @@
- UploadUpload (max )New folderDownloadShareDelete @@ -9,9 +9,10 @@ href="" title="" class="delete">Delete