mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-09 06:31:22 +00:00
GUAC-1172: Implement navigation via breadcrumbs - no more tree.
This commit is contained in:
@@ -28,6 +28,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
|
||||
// Required types
|
||||
var ManagedClientState = $injector.get('ManagedClientState');
|
||||
var ManagedFilesystem = $injector.get('ManagedFilesystem');
|
||||
var ScrollState = $injector.get('ScrollState');
|
||||
|
||||
// Required services
|
||||
@@ -595,6 +596,45 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
return !!$scope.filesystemMenuContents && $scope.menu.shown;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the full path to the given file as an ordered array of parent
|
||||
* directories.
|
||||
*
|
||||
* @param {ManagedFilesystem.File} file
|
||||
* The file whose full path should be retrieved.
|
||||
*
|
||||
* @returns {ManagedFilesystem.File[]}
|
||||
* An array of directories which make up the hierarchy containing the
|
||||
* given file, in order of increasing depth.
|
||||
*/
|
||||
$scope.getPath = function getPath(file) {
|
||||
|
||||
var path = [];
|
||||
|
||||
// Add all files to path in ascending order of depth
|
||||
while (file && file.parent) {
|
||||
path.unshift(file);
|
||||
file = file.parent;
|
||||
}
|
||||
|
||||
return path;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Changes the current directory of the given filesystem to the given
|
||||
* directory.
|
||||
*
|
||||
* @param {ManagedFilesystem} filesystem
|
||||
* The filesystem whose current directory should be changed.
|
||||
*
|
||||
* @param {ManagedFilesystem.File} file
|
||||
* The directory to change to.
|
||||
*/
|
||||
$scope.changeDirectory = function changeDirectory(filesystem, file) {
|
||||
ManagedFilesystem.changeDirectory(filesystem, file);
|
||||
};
|
||||
|
||||
// Clean up when view destroyed
|
||||
$scope.$on('$destroy', function clientViewDestroyed() {
|
||||
|
||||
|
Reference in New Issue
Block a user