Updates the legacy linkpicker to show udi links properly, i.e. translate them to nice internal urls

This commit is contained in:
mikkelhm
2017-03-21 11:48:50 +01:00
parent ce8286dadd
commit de9c5b88ab

View File

@@ -22,17 +22,19 @@ angular.module("umbraco").controller("Umbraco.Dialogs.LinkPickerController",
$scope.target = dialogOptions.currentTarget;
//if we have a node ID, we fetch the current node to build the form data
if ($scope.target.id) {
if ($scope.target.id || $scope.target.udi) {
var id = $scope.target.udi ? $scope.target.udi : $scope.target.id;
if (!$scope.target.path) {
entityResource.getPath($scope.target.id, "Document").then(function (path) {
entityResource.getPath(id, "Document").then(function (path) {
$scope.target.path = path;
//now sync the tree to this path
$scope.dialogTreeEventHandler.syncTree({ path: $scope.target.path, tree: "content" });
});
}
contentResource.getNiceUrl($scope.target.id).then(function (url) {
contentResource.getNiceUrl(id).then(function (url) {
$scope.target.url = url;
});
}