diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js index 384c3e3a35..e1334aa816 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js @@ -76,32 +76,33 @@ function DocumentTypesCreateController($scope, $location, navigationService, con } } - contentTypeResource.createCollection(node.id, $scope.model.collectionName, $scope.model.collectionCreateTemplate, $scope.model.collectionItemName, $scope.model.collectionItemCreateTemplate, collectionIcon, collectionItemIcon).then(function (collectionData) { + contentTypeResource.createCollection(node.id, $scope.model.collectionName, $scope.model.collectionCreateTemplate, $scope.model.collectionItemName, $scope.model.collectionItemCreateTemplate, collectionIcon, collectionItemIcon) + .then(function (collectionData) { - navigationService.hideMenu(); - $location.search('create', null); - $location.search('notemplate', null); + navigationService.hideMenu(); + $location.search('create', null); + $location.search('notemplate', null); - formHelper.resetForm({ - scope: $scope - }); + formHelper.resetForm({ + scope: $scope + }); - var section = appState.getSectionState("currentSection"); + var section = appState.getSectionState("currentSection"); - // redirect to the item id - $location.path("/settings/documenttypes/edit/" + collectionData.itemId); + // redirect to the item id + $location.path("/" + section + "/documenttypes/edit/" + collectionData.containerId); - }, function (err) { + }, function (err) { - $scope.error = err; + $scope.error = err; - //show any notifications - if (angular.isArray(err.data.notifications)) { - for (var i = 0; i < err.data.notifications.length; i++) { - notificationsService.showNotification(err.data.notifications[i]); + //show any notifications + if (angular.isArray(err.data.notifications)) { + for (var i = 0; i < err.data.notifications.length; i++) { + notificationsService.showNotification(err.data.notifications[i]); + } } - } - }); + }); }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js index 8a9f1b743a..b4f031935a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js @@ -463,9 +463,11 @@ /** Syncs the content type to it's tree node - this occurs on first load and after saving */ function syncTreeNode(dt, path, initialLoad) { - navigationService.syncTree({ tree: "documenttypes", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) { - vm.currentNode = syncArgs.node; - }); + const args = { tree: "documenttypes", path: path.split(","), forceReload: initialLoad !== true }; + navigationService.syncTree(args) + .then(function (syncArgs) { + vm.currentNode = syncArgs.node; + }); } function close() {