Ensure breadcrumbs and hash are correctly updated on folder navigation

This commit is contained in:
Johannes Zellner
2021-07-13 11:31:59 +02:00
parent 30d14f5359
commit 17cc6becd2

View File

@@ -390,7 +390,6 @@ 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;
});
@@ -544,7 +543,7 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
};
$scope.goDirectoryUp = function () {
openPath($scope.cwd + '/..');
location.hash = sanitize($scope.cwd + '/..');
};
$scope.changeDirectory = function (path) {
@@ -1015,7 +1014,10 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
// now mark the Client to be ready
Client.setReady();
openPath(window.location.hash.slice(1));
var hashPath = window.location.hash.slice(1);
$scope.cwdParts = hashPath.split('/').filter(function (p) { return !!p; }).map(function (p, i) { return { name: decodeURIComponent(p), path: hashPath.split('/').slice(0, i+1).join('/') }; });
openPath(hashPath);
$scope.initialized = true;
});
@@ -1043,7 +1045,10 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
$scope.mediaViewer.close();
$scope.textEditor.close();
openPath(window.location.hash.slice(1));
var hashPath = window.location.hash.slice(1);
$scope.cwdParts = hashPath.split('/').filter(function (p) { return !!p; }).map(function (p, i) { return { name: decodeURIComponent(p), path: hashPath.split('/').slice(0, i+1).join('/') }; });
openPath(hashPath);
});
});