[Fixed Position] Modify fixed position to use the Selection API
Change method name to shouldSelect() as requested by the reviewer. Fix tests. Fixes #1848
This commit is contained in:
committed by
Victor Woeltjen
parent
0c6786198a
commit
14894cf197
@@ -78,7 +78,8 @@ define(
|
||||
return;
|
||||
}
|
||||
|
||||
var selectedObjectComposition = selection[0].context.oldItem.useCapability('composition');
|
||||
var selected = selection[0].context.oldItem;
|
||||
var selectedObjectComposition = selected && selected.useCapability('composition');
|
||||
|
||||
if (selectedObjectComposition) {
|
||||
selectedObjectComposition.then(function (composition) {
|
||||
|
||||
@@ -44,11 +44,17 @@ define(
|
||||
this.selectedObj = undefined;
|
||||
|
||||
openmct.selection.on('change', function (selection) {
|
||||
if (selection[0] && selection[0].context.toolbar) {
|
||||
this.select(selection[0].context.toolbar);
|
||||
var selected = selection[0];
|
||||
|
||||
if (selected && selected.context.toolbar) {
|
||||
this.select(selected.context.toolbar);
|
||||
} else {
|
||||
this.deselect();
|
||||
}
|
||||
|
||||
if (selected && selected.context.viewProxy) {
|
||||
this.proxy(selected.context.viewProxy);
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user