Open composition doctypes in infinite editor (#6387)

This commit is contained in:
Søren Kottal
2019-09-20 15:34:54 +02:00
committed by Sebastiaan Janssen
parent 705713b497
commit 362fb7722d
4 changed files with 25 additions and 1 deletions

View File

@@ -364,6 +364,22 @@
};
scope.openDocumentType = function (documentTypeId) {
const editor = {
id: documentTypeId,
submit: function (model) {
const args = { node: scope.model };
eventsService.emit("editors.documentType.reload", args);
editorService.close();
},
close: function () {
editorService.close();
}
};
editorService.documentTypeEditor(editor);
};
/* ---------- GROUPS ---------- */
scope.addGroup = function(group) {

View File

@@ -66,3 +66,5 @@
.ml5 { margin-left: @spacing-extra-large; }
.ml6 { margin-left: @spacing-extra-extra-large; }
.ml7 { margin-left: @spacing-extra-extra-extra-large; }
.p0 { padding: @spacing-none; }

View File

@@ -81,7 +81,7 @@
<i class="icon icon-merge"></i>
<localize key="contentTypeEditor_inheritedFrom"></localize>: {{ tab.inheritedFromName }}
<span ng-repeat="contentTypeName in tab.parentTabContentTypeNames">
<a href="#/settings/documentTypes/edit/{{tab.parentTabContentTypes[$index]}}">{{ contentTypeName }}</a>
<button type="button" class="btn-link btn-small p0" ng-click="openDocumentType(tab.parentTabContentTypes[$index])">{{ contentTypeName }}</button>
<span ng-if="!$last">, </span>
</span>
</div>

View File

@@ -497,6 +497,12 @@
loadDocumentType();
}));
evts.push(eventsService.on("editors.documentType.reload", function (name, args) {
if (args && args.node && vm.contentType.id === args.node.id) {
loadDocumentType();
}
}));
evts.push(eventsService.on("editors.documentType.saved", function(name, args) {
if(args.documentType.allowedTemplates.length > 0){
navigationService.syncTree({ tree: "templates", path: [], forceReload: true })