change folder icon when dragging over a directory
This commit is contained in:
parent
937d21ed29
commit
203a07e7f3
|
@ -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');
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue