mirror of
https://github.com/nasa/openmct.git
synced 2024-12-30 01:48:51 +00:00
[New Edit Mode] Selecting 'Go To Original' from elements pool navigates without prompting user to save changes #396
This commit is contained in:
parent
856c61816c
commit
2ca414d2a4
@ -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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user