Updates the legacy linkpicker to show udi links properly, i.e. translate them to nice internal urls
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user