[Plot] Highlight inspected plot legend items

Plot legend items that are being selected for
inspection are now highligted.
This commit is contained in:
slhale 2015-08-27 12:10:13 -07:00
parent bcf6bbf627
commit 1dd3d5214d
4 changed files with 21 additions and 4 deletions

View File

@ -5376,3 +5376,6 @@ input[type="text"] {
/* line 26, ../sass/inspector/_inspector.scss */
.plot-legend-item {
cursor: pointer; }
/* line 29, ../sass/inspector/_inspector.scss */
.plot-legend-item.inspected {
background-color: #005177; }

View File

@ -25,4 +25,8 @@
// Make plot legend items clickable
.plot-legend-item {
cursor: pointer;
&.inspected {
background-color: $colorKeySelectedBg;
}
}

View File

@ -29,8 +29,8 @@
<!-- ng-class is temporarily hard-coded in next element -->
<span class='plot-legend-item'
ng-repeat="telemetryObject in subplot.getTelemetryObjects()"
ng-class="plot.getLegendClass(telemetryObject)"
ng-click="ngModel.inspectionObjects[0] = telemetryObject">
ng-click="ngModel.inspectionObjects[0] = telemetryObject"
ng-class="[plot.getLegendClass(telemetryObject), plot.getInspectedClass(telemetryObject)]">
<span class='plot-color-swatch'
ng-style="{ 'background-color': plot.getColor($index) }">
</span>

View File

@ -164,7 +164,18 @@ define(
handle = undefined;
}
}
// Determines if the legend item is being inspected. If so, the class
// is 'inspected'
function getInspectedClass(telemetryObject) {
if ($scope.ngModel &&
$scope.ngModel.inspectionObjects &&
$scope.ngModel.inspectionObjects[0] === telemetryObject) {
return "inspected";
}
}
this.getInspectedClass = getInspectedClass;
this.modeOptions = new PlotModeOptions([], subPlotFactory);
this.updateValues = updateValues;
@ -179,7 +190,6 @@ define(
// Unsubscribe when the plot is destroyed
$scope.$on("$destroy", releaseSubscription);
}
/**