Fix bug, in multiurlpicker where you cannot deselect a selected entity.

(cherry picked from commit 3385947c4e)
This commit is contained in:
Lucas Bach Bisgaard
2023-03-29 09:38:27 +02:00
committed by Sebastiaan Janssen
parent 4d13345b14
commit d1975ee2cf

View File

@@ -128,6 +128,13 @@ angular.module("umbraco").controller("Umbraco.Editors.LinkPickerController",
eventsService.emit("dialogs.linkPicker.select", args);
if ($scope.currentNode) {
if ($scope.currentNode.id == args.node.id && $scope.currentNode.selected) {
$scope.model.target = {};
$scope.currentNode.selected = false;
return;
}
//un-select if there's a current one selected
$scope.currentNode.selected = false;
}