Allow to paste into directory entry
This commit is contained in:
@@ -352,11 +352,11 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
|
|||||||
$scope.clipboardCut = false;
|
$scope.clipboardCut = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.actionPaste = function () {
|
$scope.actionPaste = function (destinationEntry) {
|
||||||
if ($scope.clipboardCut) {
|
if ($scope.clipboardCut) {
|
||||||
// move files
|
// move files
|
||||||
async.eachLimit($scope.clipboard, 5, function (entry, callback) {
|
async.eachLimit($scope.clipboard, 5, function (entry, callback) {
|
||||||
var newFilePath = sanitize($scope.cwd + '/' + entry.fileName);
|
var newFilePath = sanitize($scope.cwd + '/' + (destinationEntry.isDirectory ? destinationEntry.fileName : '') + '/' + entry.fileName);
|
||||||
|
|
||||||
// TODO this will overwrite files in destination!
|
// TODO this will overwrite files in destination!
|
||||||
Client.filesRename($scope.id, $scope.type, entry.fullFilePath, newFilePath, callback);
|
Client.filesRename($scope.id, $scope.type, entry.fullFilePath, newFilePath, callback);
|
||||||
@@ -880,7 +880,7 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
|
|||||||
text: tr['filemanager.list.menu.paste'],
|
text: tr['filemanager.list.menu.paste'],
|
||||||
hasBottomDivider: true,
|
hasBottomDivider: true,
|
||||||
enabled: function () { return $scope.clipboard.length; },
|
enabled: function () { return $scope.clipboard.length; },
|
||||||
click: function ($itemScope, $event, entry) { $scope.actionPaste(); }
|
click: function ($itemScope, $event, entry) { $scope.actionPaste(entry); }
|
||||||
}, {
|
}, {
|
||||||
text: tr['filemanager.list.menu.rename'],
|
text: tr['filemanager.list.menu.rename'],
|
||||||
enabled: function () { return $scope.selected.length === 1; },
|
enabled: function () { return $scope.selected.length === 1; },
|
||||||
|
|||||||
Reference in New Issue
Block a user