From 4564623899fb265f5dc1cb62ddbf7d43a169e4e1 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 3 Jan 2019 21:04:59 +0100 Subject: [PATCH] Don't use a hardcoded folder type alias to determine folder types in the list view --- .../views/propertyeditors/listview/listview.controller.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js index 118f1b81d2..df7a574c49 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js @@ -1,4 +1,4 @@ -function listViewController($rootScope, $scope, $routeParams, $injector, $cookieStore, notificationsService, iconHelper, dialogService, editorState, localizationService, $location, appState, $timeout, $q, mediaResource, listViewHelper, userService, navigationService, treeService) { +function listViewController($rootScope, $scope, $routeParams, $injector, $cookieStore, notificationsService, iconHelper, dialogService, editorState, localizationService, $location, appState, $timeout, $q, mediaResource, listViewHelper, userService, navigationService, treeService, mediaHelper) { //this is a quick check to see if we're in create mode, if so just exit - we cannot show children for content // that isn't created yet, if we continue this will use the parent id in the route params which isn't what @@ -269,10 +269,12 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie $scope.listViewResultSet = data; //update all values for display + var section = appState.getSectionState("currentSection"); if ($scope.listViewResultSet.items) { _.each($scope.listViewResultSet.items, function (e, index) { setPropertyValues(e); - if (e.contentTypeAlias === 'Folder') { + // create the folders collection (only for media list views) + if (section === "media" && !mediaHelper.hasFilePropertyType(e)) { $scope.folders.push(e); } });