mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 01:42:31 +00:00
Merge remote-tracking branch 'github/open199c' into open199d
This commit is contained in:
commit
5b325a9698
@ -96,6 +96,7 @@ define(
|
||||
toClear = [], // Properties to clear out of scope on change
|
||||
counter = 0,
|
||||
couldRepresent = false,
|
||||
couldEdit = false,
|
||||
lastId,
|
||||
lastKey,
|
||||
changeTemplate = templateLinker.link($scope, element);
|
||||
@ -143,11 +144,13 @@ define(
|
||||
});
|
||||
}
|
||||
|
||||
function unchanged(canRepresent, id, key) {
|
||||
function unchanged(canRepresent, canEdit, id, key) {
|
||||
return canRepresent &&
|
||||
couldRepresent &&
|
||||
id === lastId &&
|
||||
key === lastKey;
|
||||
key === lastKey &&
|
||||
canEdit &&
|
||||
couldEdit;
|
||||
}
|
||||
|
||||
// General-purpose refresh mechanism; should set up the scope
|
||||
@ -159,10 +162,11 @@ define(
|
||||
path = representation && getPath(representation),
|
||||
uses = ((representation || {}).uses || []),
|
||||
canRepresent = !!(path && domainObject),
|
||||
canEdit = !!(domainObject && domainObject.hasCapability('editor')),
|
||||
id = domainObject && domainObject.getId(),
|
||||
key = $scope.key;
|
||||
|
||||
if (unchanged(canRepresent, id, key)) {
|
||||
if (unchanged(canRepresent, canEdit, id, key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -190,6 +194,7 @@ define(
|
||||
|
||||
// To allow simplified change detection next time around
|
||||
couldRepresent = canRepresent;
|
||||
couldEdit = canEdit;
|
||||
lastId = id;
|
||||
lastKey = key;
|
||||
|
||||
|
@ -81,7 +81,7 @@ define(
|
||||
//Refresh domain object on each dragOver to catch external
|
||||
// updates to the model
|
||||
//Don't use EditableDomainObject for folders, allow immediate persistence
|
||||
editableDomainObject = domainObject instanceof EditableDomainObject || domainObject.getModel().type==='folder' ? domainObject : new EditableDomainObject(domainObject, $q);
|
||||
editableDomainObject = domainObject.getDomainObject || domainObject.getModel().type==='folder' ? domainObject : new EditableDomainObject(domainObject, $q);
|
||||
actionCapability = editableDomainObject.getCapability('action');
|
||||
|
||||
var event = (e || {}).originalEvent || e,
|
||||
|
Loading…
x
Reference in New Issue
Block a user