[New Edit Mode] Selecting 'Go To Original' from elements pool navigates without prompting user to save changes #396

This commit is contained in:
Henry 2015-12-09 15:23:26 -08:00
parent 856c61816c
commit 2ca414d2a4

View File

@ -88,6 +88,7 @@ define(
}
if (isDirty() && !confirm(CONFIRM_MSG)) {
$scope.treeModel.selectedObject = $scope.navigatedObject;
navigationService.setNavigation($scope.navigatedObject);
} else {
if ($scope.navigatedObject && $scope.navigatedObject.hasCapability("editor")){
@ -100,17 +101,6 @@ define(
}
}
function setSelectedObject(domainObject) {
if (domainObject !== $scope.navigatedObject && isDirty() && !confirm(CONFIRM_MSG)) {
$scope.treeModel.selectedObject = $scope.navigatedObject;
} else {
if (domainObject !== $scope.navigatedObject && $scope.navigatedObject.hasCapability('editor')){
$scope.navigatedObject.getCapability('action').perform('cancel');
}
setNavigation(domainObject);
}
}
function navigateTo(domainObject) {
// Check if an object has been navigated-to already...
@ -188,7 +178,7 @@ define(
navigationService.addListener(setNavigation);
// Also listen for changes which come from the tree
$scope.$watch("treeModel.selectedObject", setSelectedObject);
$scope.$watch("treeModel.selectedObject", setNavigation);
// Clean up when the scope is destroyed
$scope.$on("$destroy", function () {