mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 16:36:13 +00:00
Fixed cancel and drop-initiated edit
This commit is contained in:
parent
4f0f9e4104
commit
7849803a5d
@ -76,6 +76,9 @@ define(
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -163,15 +166,6 @@ define(
|
||||
return hasChanges;
|
||||
}
|
||||
|
||||
function beforeNavigateWarning (){
|
||||
if (isDirty()) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.beforeUnloadWarning = function() {
|
||||
return isDirty() ?
|
||||
"Unsaved changes will be lost if you leave this page." :
|
||||
|
@ -75,6 +75,7 @@ define(
|
||||
var editableObject;
|
||||
if (!this.domainObject.hasCapability("editor")) {
|
||||
editableObject = new EditableDomainObject(this.domainObject, this.$q);
|
||||
editableObject.getCapability('status').set('editing', true);
|
||||
this.navigationService.setNavigation(editableObject);
|
||||
}
|
||||
//this.$location.path("/edit");
|
||||
|
@ -118,7 +118,6 @@ define(
|
||||
|
||||
cache = new EditableDomainObjectCache(EditableDomainObjectImpl, $q);
|
||||
cachedObject = cache.getEditableObject(domainObject);
|
||||
cachedObject.getCapability('status').set('editing', true);
|
||||
|
||||
return cachedObject;
|
||||
}
|
||||
|
@ -137,6 +137,8 @@ define(
|
||||
domainObjectType = editableDomainObject.getModel().type,
|
||||
virtualObj;
|
||||
|
||||
editableDomainObject.getCapability('status').set('editing', true);
|
||||
|
||||
// If currently in edit mode allow drag and drop gestures to the
|
||||
// domain object. An exception to this is folders which have drop
|
||||
// gestures in browse mode.
|
||||
|
Loading…
x
Reference in New Issue
Block a user