diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-04-15 16:06:16 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-04-15 16:06:55 +0200 |
commit | c0bdad58932a29a1f21909e959416369a790fa8d (patch) | |
tree | 46e298209a68c033797bc632b175e190aab15343 | |
parent | dae34edf4f1f48f5d74f3704939a0e846bcb6267 (diff) | |
download | nextcloud-server-c0bdad58932a29a1f21909e959416369a790fa8d.tar.gz nextcloud-server-c0bdad58932a29a1f21909e959416369a790fa8d.zip |
dont allow draging files to the current directory
-rw-r--r-- | files/js/files.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/files/js/files.js b/files/js/files.js index 1c0a40c2368..2d943d85cd4 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -13,9 +13,11 @@ $(document).ready(function() { //drag/drop of files $('#fileList tr td.filename').draggable(dragOptions); $('#fileList tr[data-type="dir"][data-write="true"] td.filename').droppable(folderDropOptions); - $('div.crumb').droppable(crumbDropOptions); + $('div.crumb:not(.last)').droppable(crumbDropOptions); $('ul#apps>li:first-child').data('dir',''); - $('ul#apps>li:first-child').droppable(crumbDropOptions); + if($('div.crumb').length){ + $('ul#apps>li:first-child').droppable(crumbDropOptions); + } // Triggers invisible file input $('.file_upload_button_wrapper').live('click', function() { @@ -412,7 +414,7 @@ var dragOptions={ }; var folderDropOptions={ drop: function( event, ui ) { - var file=ui.draggable.text().trim(); + var file=ui.draggable.parent().data('file'); var target=$(this).text().trim(); var dir=$('#dir').val(); $.ajax({ @@ -438,7 +440,7 @@ var crumbDropOptions={ if(dir.substr(-1,1)!='/'){ dir=dir+'/'; } - if(target==dir){ + if(target==dir || target+'/'==dir){ return; } $.ajax({ |