diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index 8e30ef66c5..e9ee77bec1 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -36,14 +36,13 @@ //initializes any watches function startWatches(content) { - //watch for changes to isNew & the content.id, set the page.isNew accordingly and load the breadcrumb if we can - $scope.$watchGroup(['isNew', 'content.id'], function (newVal, oldVal) { - - var contentId = newVal[1]; - $scope.page.isNew = Object.toBoolean(newVal[0]); + //watch for changes to isNew, set the page.isNew accordingly and load the breadcrumb if we can + $scope.$watch('isNew', function (newVal, oldVal) { + + $scope.page.isNew = Object.toBoolean(newVal); //We fetch all ancestors of the node to generate the footer breadcrumb navigation - if (!$scope.page.isNew && contentId && content.parentId && content.parentId !== -1) { + if (content.parentId && content.parentId !== -1) { loadBreadcrumb(); if (!watchingCulture) { $scope.$watch('culture', @@ -115,7 +114,12 @@ } function loadBreadcrumb() { - entityResource.getAncestors($scope.content.id, "document", $scope.culture) + // load the parent breadcrumb when creating new content + var id = $scope.page.isNew ? $scope.content.parentId : $scope.content.id; + if (!id) { + return; + } + entityResource.getAncestors(id, "document", $scope.culture) .then(function (anc) { $scope.ancestors = anc; }); diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbbreadcrumbs.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbbreadcrumbs.directive.js index c95af03dab..7755d9d63b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbbreadcrumbs.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbbreadcrumbs.directive.js @@ -96,6 +96,7 @@ Use this directive to generate a list of breadcrumbs. templateUrl: 'views/components/editor/umb-breadcrumbs.html', scope: { ancestors: "=", + forNewEntity: "=", entityType: "@", onOpen: "&" }, diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html index 32e91b935a..8dd78883c2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html @@ -24,6 +24,7 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-breadcrumbs.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-breadcrumbs.html index 54e599522d..1478d1da6f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-breadcrumbs.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-breadcrumbs.html @@ -2,14 +2,14 @@
  • - {{ancestor.name}} + {{ancestor.name}} - {{ancestor.name}} + {{ancestor.name}} - / + / - {{ancestor.name}} + {{ancestor.name}}