feat(table_panel): adds invert color order functionality

This commit is contained in:
carl bergquist
2015-12-11 12:01:04 +01:00
parent 5227dc679d
commit 1a8579cd6d
2 changed files with 11 additions and 0 deletions

View File

@@ -132,6 +132,9 @@
<spectrum-picker ng-model="style.colors[1]" ng-change="render()" ></spectrum-picker>
<spectrum-picker ng-model="style.colors[2]" ng-change="render()" ></spectrum-picker>
</li>
<li class="tight-form-item last">
<a class="pointer" ng-click="invertColorOrder($index)">invert order</a>
</li>
</ul>
<div class="clearfix"></div>
</div>

View File

@@ -101,6 +101,14 @@ export class TablePanelEditorCtrl {
});
};
$scope.invertColorOrder = function(index) {
var ref = $scope.panel.styles[index].colors;
var copy = ref[0];
ref[0] = ref[2];
ref[2] = copy;
$scope.render();
};
}
}