Implement keyboard shortcuts for copy/cut/paste

This commit is contained in:
Johannes Zellner
2021-02-01 17:48:57 +01:00
parent f47015223c
commit 3e04da7062

View File

@@ -371,8 +371,6 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
e.fullFilePath = sanitize(entry.fullFilePath + '/' + e.fileName);
});
console.log('=--=', result.entries)
var collectedFiles = [];
async.eachLimit(result.entries, 5, function (entry, callback) {
collectFiles(entry, function (error, result) {
@@ -932,6 +930,21 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
$scope.textEditor.save();
event.preventDefault();
}
} else if((navigator.platform.match('Mac') ? event.metaKey : event.ctrlKey) && event.key === 'c') {
if ($scope.view === 'textEditor') return;
if ($scope.selected.length === 0) return;
$scope.actionCopy();
} else if((navigator.platform.match('Mac') ? event.metaKey : event.ctrlKey) && event.key === 'x') {
if ($scope.view === 'textEditor') return;
if ($scope.selected.length === 0) return;
$scope.actionCut();
} else if((navigator.platform.match('Mac') ? event.metaKey : event.ctrlKey) && event.key === 'v') {
if ($scope.view === 'textEditor') return;
if ($scope.clipboard.length === 0) return;
$scope.actionPaste();
}
});