From f019a36ccfe016f8bd5ee8f2b27b1aa9cc5255aa Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 13 Aug 2015 13:04:32 -0700 Subject: [PATCH] GUAC-1293: Refresh file browser when any upload completes. --- .../webapp/app/client/directives/guacFileBrowser.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js b/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js index 26be23b48..0a380cf19 100644 --- a/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js +++ b/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js @@ -122,6 +122,13 @@ angular.module('client').directive('guacFileBrowser', [function guacFileBrowser( ManagedFilesystem.downloadFile($scope.client, $scope.filesystem, file.streamName); }; + /** + * Refreshes the contents of the current directory. + */ + $scope.refresh = function refresh() { + ManagedFilesystem.refresh($scope.filesystem, $scope.filesystem.currentDirectory); + }; + /** * Creates a new element representing the given file and properly * handling user events, bypassing the overhead incurred through @@ -248,6 +255,11 @@ angular.module('client').directive('guacFileBrowser', [function guacFileBrowser( }); // end retrieve file template + // Refresh file browser when any upload completes + $scope.$on('guacUploadComplete', function uploadComplete(event, filename) { + $scope.refresh(); + }); + }] };