[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:
slhale 2015-08-27 12:35:50 -07:00
parent 1dd3d5214d
commit 4de8d91890
2 changed files with 16 additions and 5 deletions

View File

@ -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

View File

@ -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;