mirror of
https://github.com/nasa/openmct.git
synced 2025-06-17 06:38:17 +00:00
Go to original now shows prompt
This commit is contained in:
@ -82,10 +82,22 @@ define(
|
|||||||
// Callback for updating the in-scope reference to the object
|
// Callback for updating the in-scope reference to the object
|
||||||
// that is currently navigated-to.
|
// that is currently navigated-to.
|
||||||
function setNavigation(domainObject) {
|
function setNavigation(domainObject) {
|
||||||
$scope.navigatedObject = domainObject;
|
if (domainObject === $scope.navigatedObject){
|
||||||
$scope.treeModel.selectedObject = domainObject;
|
//do nothing;
|
||||||
navigationService.setNavigation(domainObject);
|
return;
|
||||||
updateRoute(domainObject);
|
}
|
||||||
|
|
||||||
|
if (isDirty() && !confirm(CONFIRM_MSG)) {
|
||||||
|
navigationService.setNavigation($scope.navigatedObject);
|
||||||
|
} else {
|
||||||
|
if ($scope.navigatedObject && $scope.navigatedObject.hasCapability("editor")){
|
||||||
|
$scope.navigatedObject.getCapability("editor").cancel();
|
||||||
|
}
|
||||||
|
$scope.navigatedObject = domainObject;
|
||||||
|
$scope.treeModel.selectedObject = domainObject;
|
||||||
|
navigationService.setNavigation(domainObject);
|
||||||
|
updateRoute(domainObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSelectedObject(domainObject) {
|
function setSelectedObject(domainObject) {
|
||||||
|
@ -114,6 +114,7 @@ define(
|
|||||||
EditorCapability.prototype.cancel = function () {
|
EditorCapability.prototype.cancel = function () {
|
||||||
this.editableObject.getCapability("status").set("editing", false);
|
this.editableObject.getCapability("status").set("editing", false);
|
||||||
//TODO: Reset the cache as well here.
|
//TODO: Reset the cache as well here.
|
||||||
|
this.cache.markClean(this.editableObject);
|
||||||
return resolvePromise(undefined);
|
return resolvePromise(undefined);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user