Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit 770457c

Browse files
author
Arnold Visser
committed
Show the icon, the title of the chosen block and the description when no (pre)view is set for a dtge-block
1 parent 32cca26 commit 770457c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Our.Umbraco.DocTypeGridEditor/Web/Controllers/DocTypeGridEditorApiController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public IEnumerable<object> GetContentTypes([ModelBinder] string[] allowedContent
8686
}
8787

8888
[HttpGet]
89-
public object GetContentTypeIcon([ModelBinder] string contentTypeAlias)
89+
public object GetContentType([ModelBinder] string contentTypeAlias)
9090
{
9191
Guid docTypeGuid;
9292
if (Guid.TryParse(contentTypeAlias, out docTypeGuid))

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
$scope.title = $scope.control.value.value.name;
4444
}
4545
if ("dtgeContentTypeAlias" in $scope.control.value && $scope.control.value.dtgeContentTypeAlias) {
46-
dtgeResources.getContentTypeIcon($scope.control.value.dtgeContentTypeAlias).then(function (data2) {
46+
dtgeResources.getContentType($scope.control.value.dtgeContentTypeAlias).then(function (data2) {
47+
$scope.title = data2.title;
48+
$scope.description = data2.description;
4749
if (data2.icon) {
4850
$scope.icon = data2.icon;
4951
}

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.resources.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
'Failed to retrieve content types'
2121
);
2222
},
23-
getContentTypeIcon: function (contentTypeAlias) {
23+
getContentType: function (contentTypeAlias) {
2424
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypeIcon?contentTypeAlias=" + contentTypeAlias);
2525
return umbRequestHelper.resourcePromise(
2626
$http.get(url),

0 commit comments

Comments
 (0)