mirror of
https://github.com/nasa/openmct.git
synced 2025-01-17 10:20:27 +00:00
[New Edit Mode] Create menu still visible when edit mode initiated by pressing create #407
This commit is contained in:
parent
5fd762fea9
commit
ac379dbb3f
@ -94,6 +94,7 @@ define(
|
|||||||
newObject = parentObject.useCapability('instantiation', newModel);
|
newObject = parentObject.useCapability('instantiation', newModel);
|
||||||
editableObject = new EditableDomainObject(newObject, this.$q);
|
editableObject = new EditableDomainObject(newObject, this.$q);
|
||||||
editableObject.setOriginalObject(parentObject);
|
editableObject.setOriginalObject(parentObject);
|
||||||
|
editableObject.getCapability('status').set('editing', true);
|
||||||
editableObject.useCapability('mutation', function(model){
|
editableObject.useCapability('mutation', function(model){
|
||||||
model.location = parentObject.getId();
|
model.location = parentObject.getId();
|
||||||
});
|
});
|
||||||
|
@ -102,11 +102,6 @@ define(
|
|||||||
return domainObject;
|
return domainObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
function doNothing() {
|
|
||||||
// Create cancelled, do nothing
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAllComposees(domainObject){
|
function getAllComposees(domainObject){
|
||||||
return domainObject.useCapability('composition');
|
return domainObject.useCapability('composition');
|
||||||
}
|
}
|
||||||
@ -134,7 +129,7 @@ define(
|
|||||||
|
|
||||||
return self.dialogService
|
return self.dialogService
|
||||||
.getUserInput(wizard.getFormStructure(), wizard.getInitialFormValue())
|
.getUserInput(wizard.getFormStructure(), wizard.getInitialFormValue())
|
||||||
.then(buildObjectFromInput, doNothing);
|
.then(buildObjectFromInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -159,6 +154,11 @@ define(
|
|||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doNothing() {
|
||||||
|
// Create cancelled, do nothing
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Invoke any save behavior introduced by the editor capability;
|
// Invoke any save behavior introduced by the editor capability;
|
||||||
// this is introduced by EditableDomainObject which is
|
// this is introduced by EditableDomainObject which is
|
||||||
// used to insulate underlying objects from changes made
|
// used to insulate underlying objects from changes made
|
||||||
@ -177,7 +177,8 @@ define(
|
|||||||
.then(persistObject)
|
.then(persistObject)
|
||||||
.then(function(){
|
.then(function(){
|
||||||
return fetchObject(domainObject.getId());
|
return fetchObject(domainObject.getId());
|
||||||
});
|
})
|
||||||
|
.catch(doNothing)
|
||||||
} else {
|
} else {
|
||||||
return domainObject.getCapability("editor").save()
|
return domainObject.getCapability("editor").save()
|
||||||
.then(resolveWith(domainObject.getOriginalObject()));
|
.then(resolveWith(domainObject.getOriginalObject()));
|
||||||
|
Loading…
Reference in New Issue
Block a user