diff options
author | Vincent Chan <plus.vincchan@gmail.com> | 2016-06-15 01:03:59 +0200 |
---|---|---|
committer | Vincent Chan <plus.vincchan@gmail.com> | 2016-06-15 01:03:59 +0200 |
commit | 203a07e7f35aeef8e22385b0a9fec216387430e4 (patch) | |
tree | c9bad3f5c0c76f3cbcfcb0ba74dc088ace52eb20 /apps/files | |
parent | 937d21ed29f29f424aaed7abb643a210ccb2453b (diff) | |
download | nextcloud-server-203a07e7f35aeef8e22385b0a9fec216387430e4.tar.gz nextcloud-server-203a07e7f35aeef8e22385b0a9fec216387430e4.zip |
change folder icon when dragging over a directory
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/css/files.css | 4 | ||||
-rw-r--r-- | apps/files/js/file-upload.js | 15 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 2 |
3 files changed, 17 insertions, 4 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css index c462e27ff14..980332d781b 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -77,6 +77,10 @@ background-color: rgb(179, 230, 255); } +.dropping-to-dir .thumbnail { + background-image: url(/nextcloud/core/img/filetypes/folder-drag-accept.svg)!important; +} + /* icons for sidebar */ .nav-icon-files { background-image: url('../img/folder.svg'); diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index eadb57d914d..dbf08ac10b9 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -667,11 +667,22 @@ OC.Upload = { OC.Upload._hideProgressBar(); } }); - fileupload.on('fileuploaddragover', function(){ + fileupload.on('fileuploaddragover', function(e, data){ $('#app-content').addClass('file-drag'); + + var filerow = $(e.delegatedEvent.target).closest('tr'); + + if(!filerow.hasClass('dropping-to-dir')){ + $('.dropping-to-dir').removeClass('dropping-to-dir'); + } + + if(filerow.attr('data-type') === 'dir'){ + filerow.addClass('dropping-to-dir'); + } }); - fileupload.on('fileuploaddragleave fileuploaddrop', function (){ + fileupload.on('fileuploaddragleave fileuploaddrop', function (e, data){ $('#app-content').removeClass('file-drag'); + $('.dropping-to-dir').removeClass('dropping-to-dir'); }); } else { // for all browsers that don't support the progress bar diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 4b1c07b297e..3ab5032599c 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2528,9 +2528,7 @@ return false; } - console.log(e); var dropTarget = $(e.delegatedEvent.target); - console.log(dropTarget); // check if dropped inside this container and not another one if (dropTarget.length |