Merge pull request #3943 from spalger/visualizeEditorTouch

[visualize] when an agg is closed, 'touch' its form to show it's errors
This commit is contained in:
Joe Fleming 2015-05-22 10:24:54 -07:00
commit ee668579a2

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',