V8: Don't load the breadcrumb twice when editing content (#5454)

V8: Don't load the breadcrumb twice when editing content
This commit is contained in:
Sebastiaan Janssen
2019-05-31 16:41:43 +02:00
committed by GitHub

View File

@@ -67,16 +67,12 @@
//We fetch all ancestors of the node to generate the footer breadcrumb navigation
if (!$scope.page.isNew) {
if (content.parentId && content.parentId !== -1) {
entityResource.getAncestors(content.id, "document", $scope.culture)
.then(function (anc) {
$scope.ancestors = anc;
});
loadBreadcrumb();
$scope.$watch('culture',
function (value, oldValue) {
entityResource.getAncestors(content.id, "document", value)
.then(function (anc) {
$scope.ancestors = anc;
});
if (value !== oldValue) {
loadBreadcrumb();
}
});
}
}
@@ -86,6 +82,12 @@
resetVariantFlags();
}
function loadBreadcrumb() {
entityResource.getAncestors($scope.content.id, "document", $scope.culture)
.then(function (anc) {
$scope.ancestors = anc;
});
}
/**
* This will reset isDirty flags if save is true.