[visualize] when an agg is closed, 'touch' its form to show it's errors

This commit is contained in:
Spencer Alger 2015-05-22 07:39:07 -07:00
parent 3c28b3d870
commit 9263b5f7ae

View file

@ -21,9 +21,12 @@ define(function (require) {
link: function ($scope, $el, attrs, kbnForm) {
$scope.$bind('outputAgg', 'outputVis.aggs.byId[agg.id]', $scope);
$scope.editorOpen = !!$scope.agg.brandNew;
if (!$scope.editorOpen) {
$scope.$evalAsync(kbnForm.$setTouched);
}
$scope.$watch('editorOpen', function (open) {
// make sure that all of the form inputs are "touched"
// so that their errors propogate
if (!open) kbnForm.$setTouched();
});
$scope.$watchMulti([
'$index',