Support moving files across folders when renaming

This commit is contained in:
Johannes Zellner
2020-07-23 12:07:24 +02:00
parent e82f17ab06
commit 7d4f617757

View File

@@ -378,7 +378,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
$scope.renameEntry.busy = true;
var oldFilePath = sanitize($scope.cwd + '/' + $scope.renameEntry.entry.fileName);
var newFilePath = sanitize($scope.cwd + '/' + $scope.renameEntry.newName);
var newFilePath = sanitize(($scope.renameEntry.newName[0] === '/' ? '' : ($scope.cwd + '/')) + $scope.renameEntry.newName);
Client.filesRename($scope.appId, oldFilePath, newFilePath, function (error, result) {
$scope.renameEntry.busy = false;