mirror of
https://github.com/nasa/openmct.git
synced 2024-12-21 22:17:49 +00:00
[Edit] Cancel action depends on promise resolution
Cancel action no longer cares about return value, simply will not execute if navigtion promise does not resolve. https://github.com/nasa/openmct/issues/1360
This commit is contained in:
parent
fcda211800
commit
6328bd9354
@ -56,13 +56,13 @@ define(
|
|||||||
//navigate back to parent because nothing to show.
|
//navigate back to parent because nothing to show.
|
||||||
return domainObject.getCapability("location").getOriginal().then(function (original) {
|
return domainObject.getCapability("location").getOriginal().then(function (original) {
|
||||||
parent = original.getCapability("context").getParent();
|
parent = original.getCapability("context").getParent();
|
||||||
parent.getCapability("action").perform("navigate");
|
return parent.getCapability("action").perform("navigate");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancel(allowed) {
|
function cancel() {
|
||||||
return allowed && domainObject.getCapability("editor").finish();
|
return domainObject.getCapability("editor").finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Do navigation first in order to trigger unsaved changes dialog
|
//Do navigation first in order to trigger unsaved changes dialog
|
||||||
|
Loading…
Reference in New Issue
Block a user