mirror of
https://github.com/nasa/openmct.git
synced 2025-05-21 01:37:38 +00:00
Merge pull request #1913 from nasa/layout-issue-1909
[Layout] Select fixed position view only if the parent is not selected
This commit is contained in:
commit
dc91a94f0e
@ -64,8 +64,10 @@ define(
|
|||||||
var domainObject = selection[0].context.oldItem;
|
var domainObject = selection[0].context.oldItem;
|
||||||
self.refreshComposition(domainObject);
|
self.refreshComposition(domainObject);
|
||||||
|
|
||||||
self.mutationListener = domainObject.getCapability('mutation')
|
if (domainObject) {
|
||||||
.listen(self.refreshComposition.bind(self, domainObject));
|
self.mutationListener = domainObject.getCapability('mutation')
|
||||||
|
.listen(self.refreshComposition.bind(self, domainObject));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.filterBy = filterBy;
|
$scope.filterBy = filterBy;
|
||||||
@ -86,7 +88,7 @@ define(
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ElementsController.prototype.refreshComposition = function (domainObject) {
|
ElementsController.prototype.refreshComposition = function (domainObject) {
|
||||||
var selectedObjectComposition = domainObject.useCapability('composition');
|
var selectedObjectComposition = domainObject && domainObject.useCapability('composition');
|
||||||
|
|
||||||
if (selectedObjectComposition) {
|
if (selectedObjectComposition) {
|
||||||
selectedObjectComposition.then(function (composition) {
|
selectedObjectComposition.then(function (composition) {
|
||||||
|
@ -127,6 +127,16 @@ define(
|
|||||||
expect(mockUnlisten).toHaveBeenCalled();
|
expect(mockUnlisten).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("does not listen on mutation for element proxy selectable", function () {
|
||||||
|
selectable[0] = {
|
||||||
|
context: {
|
||||||
|
elementProxy: {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
mockOpenMCT.selection.on.mostRecentCall.args[1](selectable);
|
||||||
|
|
||||||
|
expect(mockDomainObject.getCapability).not.toHaveBeenCalledWith('mutation');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -272,7 +272,7 @@ define(
|
|||||||
self.resizeHandles = self.generateDragHandles(self.selectedElementProxy);
|
self.resizeHandles = self.generateDragHandles(self.selectedElementProxy);
|
||||||
} else {
|
} else {
|
||||||
// Make fixed view selectable if it's not already.
|
// Make fixed view selectable if it's not already.
|
||||||
if (!self.fixedViewSelectable) {
|
if (!self.fixedViewSelectable && selectable.length === 1) {
|
||||||
self.fixedViewSelectable = true;
|
self.fixedViewSelectable = true;
|
||||||
selection.context.viewProxy = new FixedProxy(addElement, $q, dialogService);
|
selection.context.viewProxy = new FixedProxy(addElement, $q, dialogService);
|
||||||
self.openmct.selection.select(selection);
|
self.openmct.selection.select(selection);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user