mirror of
https://github.com/nasa/openmct.git
synced 2025-05-30 06:04:20 +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)) {
|
if (domainObject !== $scope.navigatedObject && isDirty() && !confirm(CONFIRM_MSG)) {
|
||||||
$scope.treeModel.selectedObject = $scope.navigatedObject;
|
$scope.treeModel.selectedObject = $scope.navigatedObject;
|
||||||
} else {
|
} else {
|
||||||
|
if (domainObject !== $scope.navigatedObject && $scope.navigatedObject.hasCapability('editor')){
|
||||||
|
$scope.navigatedObject.getCapability('action').perform('cancel');
|
||||||
|
}
|
||||||
setNavigation(domainObject);
|
setNavigation(domainObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -163,15 +166,6 @@ define(
|
|||||||
return hasChanges;
|
return hasChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
function beforeNavigateWarning (){
|
|
||||||
if (isDirty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$scope.beforeUnloadWarning = function() {
|
$scope.beforeUnloadWarning = function() {
|
||||||
return isDirty() ?
|
return isDirty() ?
|
||||||
"Unsaved changes will be lost if you leave this page." :
|
"Unsaved changes will be lost if you leave this page." :
|
||||||
|
@ -75,6 +75,7 @@ define(
|
|||||||
var editableObject;
|
var editableObject;
|
||||||
if (!this.domainObject.hasCapability("editor")) {
|
if (!this.domainObject.hasCapability("editor")) {
|
||||||
editableObject = new EditableDomainObject(this.domainObject, this.$q);
|
editableObject = new EditableDomainObject(this.domainObject, this.$q);
|
||||||
|
editableObject.getCapability('status').set('editing', true);
|
||||||
this.navigationService.setNavigation(editableObject);
|
this.navigationService.setNavigation(editableObject);
|
||||||
}
|
}
|
||||||
//this.$location.path("/edit");
|
//this.$location.path("/edit");
|
||||||
|
@ -118,7 +118,6 @@ define(
|
|||||||
|
|
||||||
cache = new EditableDomainObjectCache(EditableDomainObjectImpl, $q);
|
cache = new EditableDomainObjectCache(EditableDomainObjectImpl, $q);
|
||||||
cachedObject = cache.getEditableObject(domainObject);
|
cachedObject = cache.getEditableObject(domainObject);
|
||||||
cachedObject.getCapability('status').set('editing', true);
|
|
||||||
|
|
||||||
return cachedObject;
|
return cachedObject;
|
||||||
}
|
}
|
||||||
|
@ -137,6 +137,8 @@ define(
|
|||||||
domainObjectType = editableDomainObject.getModel().type,
|
domainObjectType = editableDomainObject.getModel().type,
|
||||||
virtualObj;
|
virtualObj;
|
||||||
|
|
||||||
|
editableDomainObject.getCapability('status').set('editing', true);
|
||||||
|
|
||||||
// If currently in edit mode allow drag and drop gestures to the
|
// If currently in edit mode allow drag and drop gestures to the
|
||||||
// domain object. An exception to this is folders which have drop
|
// domain object. An exception to this is folders which have drop
|
||||||
// gestures in browse mode.
|
// gestures in browse mode.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user