mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 07:38:15 +00:00
Implements selection and reorder in stacked plots (#2371)
* working selection in stacked plots * reorder in stacked plots works * tabs code cleanup
This commit is contained in:
committed by
Pegah Sarram
parent
548286bacd
commit
ee1d92d4a9
@ -43,12 +43,16 @@
|
||||
<div class="l-view-section">
|
||||
<div class="c-loading--overlay loading"
|
||||
ng-show="!!currentRequest.pending"></div>
|
||||
<div class="gl-plot child-frame"
|
||||
<div class="gl-plot child-frame u-inspectable"
|
||||
ng-repeat="telemetryObject in telemetryObjects"
|
||||
ng-class="{
|
||||
's-status-timeconductor-unsynced': telemetryObject
|
||||
.getCapability('status')
|
||||
.get('timeconductor-unsynced')
|
||||
}"
|
||||
mct-selectable="{
|
||||
item: telemetryObject.useCapability('adapter'),
|
||||
oldItem: telemetryObject
|
||||
}">
|
||||
<mct-overlay-plot domain-object="telemetryObject"></mct-overlay-plot>
|
||||
</div>
|
||||
|
@ -79,6 +79,15 @@ define([
|
||||
$scope.$broadcast('plot:tickWidth', _.max(tickWidthMap));
|
||||
}
|
||||
}
|
||||
|
||||
function compositionReorder(reorderPlan) {
|
||||
let oldComposition = telemetryObjects.slice();
|
||||
|
||||
reorderPlan.forEach((reorder) => {
|
||||
telemetryObjects[reorder.newIndex] = oldComposition[reorder.oldIndex];
|
||||
});
|
||||
}
|
||||
|
||||
thisRequest.pending += 1;
|
||||
openmct.objects.get(domainObject.getId())
|
||||
.then(function (obj) {
|
||||
@ -89,10 +98,12 @@ define([
|
||||
composition = openmct.composition.get(obj);
|
||||
composition.on('add', addChild);
|
||||
composition.on('remove', removeChild);
|
||||
composition.on('reorder', compositionReorder);
|
||||
composition.load();
|
||||
unlisten = function () {
|
||||
composition.off('add', addChild);
|
||||
composition.off('remove', removeChild);
|
||||
composition.off('reorder', compositionReorder);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user