diff --git a/src/filemanager.html b/src/filemanager.html index ee1926066..47fd02cc5 100644 --- a/src/filemanager.html +++ b/src/filemanager.html @@ -298,10 +298,10 @@
- +
- +
diff --git a/src/js/filemanager.js b/src/js/filemanager.js index 4ccf1d83c..d21ab7a16 100644 --- a/src/js/filemanager.js +++ b/src/js/filemanager.js @@ -144,7 +144,6 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl if (entry.isDirectory) { $scope.cwd = path; - $scope.cwdParts = path.split('/').filter(function (p) { return !!p; }).map(function (p, i) { return { name: decodeURIComponent(p), path: path.split('/').slice(0, i+1).join('/') }; }); // refresh will set busy to false once done $scope.refresh(); @@ -390,6 +389,7 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl }); $scope.entries = result.entries; + $scope.cwdParts = $scope.cwd.split('/').filter(function (p) { return !!p; }).map(function (p, i) { return { name: decodeURIComponent(p), path: $scope.cwd.split('/').slice(0, i+1).join('/') }; }); $scope.busy = false; }); @@ -1024,7 +1024,19 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl init(); + var busyHash = window.location.hash.slice(1); + $scope.$watch('busy', function (prev, next) { + if (!prev && next) { + window.location.hash = busyHash; + busyHash = window.location.hash.slice(1); + } + }); + window.addEventListener('hashchange', function () { + if ($scope.busy) return false; + + busyHash = window.location.hash.slice(1); + $scope.$apply(function () { // first close all dialogs $scope.mediaViewer.close();