mirror of
https://github.com/nasa/openmct.git
synced 2024-12-28 08:58:52 +00:00
[Inspector] Multiple selection of plot legend items
Can now shift-click to add more than one object to the inspector array. Does not yet reflect in inspector itself.
This commit is contained in:
parent
1dd3d5214d
commit
4de8d91890
@ -29,16 +29,13 @@
|
||||
<!-- ng-class is temporarily hard-coded in next element -->
|
||||
<span class='plot-legend-item'
|
||||
ng-repeat="telemetryObject in subplot.getTelemetryObjects()"
|
||||
ng-click="ngModel.inspectionObjects[0] = telemetryObject"
|
||||
ng-click="plot.setInspection($event, telemetryObject)"
|
||||
ng-class="[plot.getLegendClass(telemetryObject), plot.getInspectedClass(telemetryObject)]">
|
||||
<span class='plot-color-swatch'
|
||||
ng-style="{ 'background-color': plot.getColor($index) }">
|
||||
</span>
|
||||
<span class='title-label'>{{telemetryObject.getModel().name}}</span>
|
||||
</span>
|
||||
|
||||
<!--{{ log(domainObject.getModel()); log(selectedObject.getModel()) }}-->
|
||||
{{ log(ngModel.inspectionObjects[0].getModel()); log(ngModel.selectedObject.getModel()) }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
|
@ -170,12 +170,26 @@ define(
|
||||
function getInspectedClass(telemetryObject) {
|
||||
if ($scope.ngModel &&
|
||||
$scope.ngModel.inspectionObjects &&
|
||||
$scope.ngModel.inspectionObjects[0] === telemetryObject) {
|
||||
$scope.ngModel.inspectionObjects.indexOf(telemetryObject) !== -1) {
|
||||
return "inspected";
|
||||
}
|
||||
}
|
||||
this.getInspectedClass = getInspectedClass;
|
||||
|
||||
//
|
||||
function setInspectionObjects(event, telemetryObject) {
|
||||
if (event.shiftKey) {
|
||||
// This was a shift-click, so we want multiple selection
|
||||
$scope.ngModel.inspectionObjects.push(telemetryObject);
|
||||
console.log('push');
|
||||
} else {
|
||||
// Otherwise replace the old set of inspection objects with this
|
||||
$scope.ngModel.inspectionObjects = [telemetryObject];
|
||||
console.log('replace');
|
||||
}
|
||||
}
|
||||
this.setInspection = setInspectionObjects;
|
||||
|
||||
this.modeOptions = new PlotModeOptions([], subPlotFactory);
|
||||
this.updateValues = updateValues;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user