mirror of
https://github.com/nasa/openmct.git
synced 2025-01-17 10:20:27 +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)) {
|
if (isDirty() && !confirm(CONFIRM_MSG)) {
|
||||||
|
$scope.treeModel.selectedObject = $scope.navigatedObject;
|
||||||
navigationService.setNavigation($scope.navigatedObject);
|
navigationService.setNavigation($scope.navigatedObject);
|
||||||
} else {
|
} else {
|
||||||
if ($scope.navigatedObject && $scope.navigatedObject.hasCapability("editor")){
|
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) {
|
function navigateTo(domainObject) {
|
||||||
|
|
||||||
// Check if an object has been navigated-to already...
|
// Check if an object has been navigated-to already...
|
||||||
@ -188,7 +178,7 @@ define(
|
|||||||
navigationService.addListener(setNavigation);
|
navigationService.addListener(setNavigation);
|
||||||
|
|
||||||
// Also listen for changes which come from the tree
|
// 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
|
// Clean up when the scope is destroyed
|
||||||
$scope.$on("$destroy", function () {
|
$scope.$on("$destroy", function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user