mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 05:38:12 +00:00
Resolved merge conflicts
This commit is contained in:
@ -158,6 +158,7 @@ define(
|
||||
var domainObject = (context || {}).domainObject;
|
||||
return domainObject !== undefined &&
|
||||
domainObject.hasCapability("editor") &&
|
||||
domainObject.getCapability("editor").inEditContext() &&
|
||||
domainObject.getModel().persisted === undefined;
|
||||
};
|
||||
|
||||
|
@ -49,7 +49,7 @@ define(
|
||||
* currently being edited.
|
||||
* @returns boolean
|
||||
*/
|
||||
EditorCapability.prototype.isEditing = function () {
|
||||
EditorCapability.prototype.inEditContext = function () {
|
||||
return isEditing(this.domainObject);
|
||||
};
|
||||
|
||||
|
@ -72,9 +72,8 @@ define(
|
||||
*/
|
||||
function isEditing(context) {
|
||||
var domainObject = (context || {}).domainObject;
|
||||
return domainObject &&
|
||||
domainObject.hasCapability('status') &&
|
||||
domainObject.getCapability('status').get('editing');
|
||||
return domainObject
|
||||
&& domainObject.getCapability('status').get('editing');
|
||||
}
|
||||
|
||||
EditActionPolicy.prototype.allow = function (action, context) {
|
||||
|
@ -40,7 +40,7 @@ define([], function () {
|
||||
|
||||
if (key === 'link') {
|
||||
object = context.selectedObject || context.domainObject;
|
||||
return !(object.hasCapability("editor") && object.getCapability("editor").isEditing());
|
||||
return !(object.hasCapability("editor") && object.getCapability("editor").inEditContext());
|
||||
}
|
||||
|
||||
// Like all policies, allow by default.
|
||||
|
@ -37,8 +37,8 @@ define([], function () {
|
||||
selectedObject = context.selectedObject,
|
||||
key = action.getMetadata().key;
|
||||
|
||||
if (key === 'move' && domainObject.hasCapability('editor') && domainObject.getCapability('editor').isEditing()) {
|
||||
return !!selectedObject && selectedObject.hasCapability('editor') && selectedObject.getCapability('editor').isEditing();
|
||||
if (key === 'move' && domainObject.hasCapability('editor') && domainObject.getCapability('editor').inEditContext()) {
|
||||
return !!selectedObject && selectedObject.hasCapability('editor') && selectedObject.getCapability('editor').inEditContext();
|
||||
}
|
||||
|
||||
// Like all policies, allow by default.
|
||||
|
@ -37,7 +37,7 @@ define(
|
||||
// If a view is flagged as non-editable, only allow it
|
||||
// while we're not in Edit mode.
|
||||
if ((view || {}).editable === false) {
|
||||
return !(domainObject.hasCapability('editor') && domainObject.getCapability('editor').isEditing());
|
||||
return !(domainObject.hasCapability('editor') && domainObject.getCapability('status').get('editing'));
|
||||
}
|
||||
|
||||
// Like all policies, allow by default.
|
||||
|
Reference in New Issue
Block a user