Merge pull request #1875 from umbraco/temp-U4-9753

fixes: U4-9753 When uploading, moving or deleting folders in the medi…
This commit is contained in:
Sebastiaan Janssen
2017-04-11 22:00:40 +02:00
committed by GitHub
2 changed files with 9 additions and 9 deletions

View File

@@ -54,8 +54,6 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie
$scope.actionInProgress = false;
$scope.selection = [];
$scope.folders = [];
//tracks if we've already loaded the folders for the current node
var foldersLoaded = false;
$scope.listViewResultSet = {
totalPages: 0,
items: []
@@ -217,7 +215,7 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie
500);
if (reload === true) {
$scope.reloadView($scope.contentId);
$scope.reloadView($scope.contentId, true);
}
if (err.data && angular.isArray(err.data.notifications)) {
@@ -252,7 +250,11 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie
/*Pagination is done by an array of objects, due angularJS's funky way of monitoring state
with simple values */
$scope.reloadView = function (id) {
$scope.getContent = function() {
$scope.reloadView($scope.contentId, true);
}
$scope.reloadView = function (id, reloadFolders) {
$scope.viewLoaded = false;
@@ -270,13 +272,12 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie
});
}
if (!foldersLoaded && $scope.entityType === 'media') {
if (reloadFolders && $scope.entityType === 'media') {
//The folders aren't loaded - we only need to do this once since we're never changing node ids
mediaResource.getChildFolders($scope.contentId)
.then(function (folders) {
$scope.folders = folders;
$scope.viewLoaded = true;
foldersLoaded = true;
});
} else {
@@ -319,7 +320,6 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie
function makeSearch() {
if ($scope.options.filter !== null && $scope.options.filter !== undefined) {
$scope.options.pageNumber = 1;
//$scope.actionInProgress = true;
$scope.reloadView($scope.contentId);
}
}
@@ -621,7 +621,7 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie
$scope.options.allowBulkMove ||
$scope.options.allowBulkDelete;
$scope.reloadView($scope.contentId);
$scope.reloadView($scope.contentId, true);
}
function getLocalizedKey(alias) {

View File

@@ -157,7 +157,7 @@
selection="selection"
options="options"
entity-type="{{entityType}}"
on-get-content="reloadView">
on-get-content="getContent">
</umb-list-view-layout>
<umb-load-indicator ng-show="!viewLoaded"></umb-load-indicator>