Improve two view pane
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
angular.module('Application').component('filetree', {
|
||||
bindings: {
|
||||
backendId: '<',
|
||||
backendType: '<'
|
||||
backendType: '<',
|
||||
view: '<'
|
||||
},
|
||||
templateUrl: 'components/filetree.html?<%= revision %>',
|
||||
controller: [ '$scope', '$translate', '$timeout', 'Client', FileTreeController ]
|
||||
@@ -15,6 +16,7 @@ angular.module('Application').component('filetree', {
|
||||
function FileTreeController($scope, $translate, $timeout, Client) {
|
||||
$scope.backendId = this.backendId;
|
||||
$scope.backendType = this.backendType;
|
||||
$scope.view = this.view;
|
||||
|
||||
$scope.busy = true;
|
||||
$scope.client = Client;
|
||||
@@ -26,7 +28,6 @@ function FileTreeController($scope, $translate, $timeout, Client) {
|
||||
$scope.clipboard = []; // holds cut or copied entries
|
||||
$scope.clipboardCut = false; // if action is cut or copy
|
||||
$scope.dropToBody = false;
|
||||
$scope.view = 'fileTree';
|
||||
$scope.applicationLink = '';
|
||||
|
||||
$scope.owners = [
|
||||
@@ -968,4 +969,19 @@ function FileTreeController($scope, $translate, $timeout, Client) {
|
||||
}
|
||||
|
||||
openPath('.');
|
||||
|
||||
// handle save shortcuts
|
||||
window.addEventListener('keydown', function (event) {
|
||||
if ($scope.$parent.activeView !== $scope.view || $scope.$parent.viewerOpen) return;
|
||||
|
||||
if (event.key === 'ArrowDown') {
|
||||
$scope.$apply(selectNext);
|
||||
} else if (event.key === 'ArrowUp') {
|
||||
$scope.$apply(selectPrev);
|
||||
} else if (event.key === 'Enter') {
|
||||
$scope.$apply(openSelected);
|
||||
} else if (event.key === 'Backspace') {
|
||||
if ($scope.view === 'fileTree') $scope.goDirectoryUp();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user