From 94c8320ba5e693771d8921b24316a7a1b21cde68 Mon Sep 17 00:00:00 2001 From: Tobias Schmidt Date: Wed, 31 Aug 2016 18:14:22 -0400 Subject: [PATCH] Reset and hide form after silence creation --- ui/app/js/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/app/js/app.js b/ui/app/js/app.js index 3157a74e..23af45ee 100644 --- a/ui/app/js/app.js +++ b/ui/app/js/app.js @@ -347,6 +347,7 @@ angular.module('am.controllers').controller('SilencesCtrl', function($scope, $lo }; $scope.$on('silence-created', function(evt) { + $scope.toggleForm(); $scope.refresh(); }); $scope.$on('silence-deleted', function(evt) { @@ -402,6 +403,11 @@ angular.module('am.controllers').controller('SilenceCreateCtrl', function($scope $scope.reset(); + $scope.$on('silence-created', function(evt) { + $scope.form.$setUntouched(); + $scope.reset(); + }); + $scope.addMatcher = function() { $scope.silence.matchers.push({}); }; @@ -414,7 +420,6 @@ angular.module('am.controllers').controller('SilenceCreateCtrl', function($scope var now = new Date; // Go through conditions that go against immutability of historic silences. var createNew = !angular.equals(origSilence.matchers, $scope.silence.matchers); - console.log(origSilence, $scope.silence); createNew = createNew || $scope.silence.elapsed; createNew = createNew || ($scope.silence.active && (origSilence.startsAt == $scope.silence.startsAt || origSilence.endsAt == $scope.silence.endsAt));