filemanager: Give visual feedback on breadcrumb drop

This commit is contained in:
Johannes Zellner
2021-02-01 20:28:55 +01:00
parent cc34847de9
commit da6ee44a2a
2 changed files with 7 additions and 3 deletions

View File

@@ -178,7 +178,9 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
$event.originalEvent.stopPropagation();
$event.originalEvent.preventDefault();
if (entry && entry.isDirectory) entry.hovered = true;
// if entry is string, we come from breadcrumb
if (entry && typeof entry === 'string') $event.currentTarget.classList.add('entry-hovered');
else if (entry && entry.isDirectory) entry.hovered = true;
else $scope.dropToBody = true;
$event.originalEvent.dataTransfer.dropEffect = 'copy';
@@ -188,7 +190,9 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
$event.originalEvent.stopPropagation();
$event.originalEvent.preventDefault();
if (entry && entry.isDirectory) entry.hovered = false;
// if entry is string, we come from breadcrumb
if (entry && typeof entry === 'string') $event.currentTarget.classList.remove('entry-hovered');
else if (entry && entry.isDirectory) entry.hovered = false;
$scope.dropToBody = false;
$event.originalEvent.dataTransfer.dropEffect = 'copy';