Ensure that the recycle bin doesn't delete content at root

This commit is contained in:
Kenn Jacobsen
2020-02-13 11:20:53 +01:00
parent b3e88040ec
commit 8370c5b42f
2 changed files with 8 additions and 3 deletions

View File

@@ -220,7 +220,7 @@ function startupLatestEditsController($scope) {
}
angular.module("umbraco").controller("Umbraco.Dashboard.StartupLatestEditsController", startupLatestEditsController);
function MediaFolderBrowserDashboardController($rootScope, $scope, $location, contentTypeResource, userService) {
function MediaFolderBrowserDashboardController($scope, $routeParams, $location, contentTypeResource, userService) {
var currentUser = {};
@@ -251,6 +251,8 @@ function MediaFolderBrowserDashboardController($rootScope, $scope, $location, co
view: dt.view
};
// tell the list view to list content at root
$routeParams.id = -1;
});
} else if (currentUser.startMediaIds.length > 0){

View File

@@ -276,6 +276,9 @@ function listViewController($scope, $interpolate, $routeParams, $injector, $time
}
$scope.reloadView = function (id, reloadActiveNode) {
if (!id) {
return;
}
$scope.viewLoaded = false;
$scope.folders = [];
@@ -713,10 +716,10 @@ function listViewController($scope, $interpolate, $routeParams, $injector, $time
}
function initView() {
//default to root id if the id is undefined
var id = $routeParams.id;
if (id === undefined) {
id = -1;
// no ID found in route params - don't list anything as we don't know for sure where we are
return;
}
getContentTypesCallback(id).then(function (listViewAllowedTypes) {