Skip to content

Commit

Permalink
fix: color picker bug at series overrides page, grafana#9715
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Oct 30, 2017
1 parent 989bf20 commit 6fa8548
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class SeriesColorPicker extends React.Component<IProps, any> {
render() {
return (
<div className="graph-legend-popover">
{this.props.series && this.renderAxisSelection()}
{this.props.series.yaxis && this.renderAxisSelection()}
<ColorPickerPopover color={this.props.series.color} onColorSelect={this.onColorChange} />
</div>
);
Expand Down
8 changes: 5 additions & 3 deletions public/app/plugins/panel/graph/series_overrides_ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ define([
$scope.setOverride = function(item, subItem) {
// handle color overrides
if (item.propertyName === 'color') {
$scope.openColorSelector();
$scope.openColorSelector($scope.override['color']);
return;
}

Expand All @@ -52,15 +52,17 @@ define([
$scope.ctrl.render();
};

$scope.openColorSelector = function() {
$scope.openColorSelector = function(color) {
var fakeSeries = {color: color};
popoverSrv.show({
element: $element.find(".dropdown")[0],
position: 'top center',
openOn: 'click',
template: '<series-color-picker onColorChange="colorSelected" />',
template: '<series-color-picker series="series" onColorChange="colorSelected" />',
model: {
autoClose: true,
colorSelected: $scope.colorSelected,
series: fakeSeries
},
onClose: function() {
$scope.ctrl.render();
Expand Down

0 comments on commit 6fa8548

Please sign in to comment.