diff --git a/ui/app/css/main.css b/ui/app/css/main.css index ee432140..bd4f0025 100644 --- a/ui/app/css/main.css +++ b/ui/app/css/main.css @@ -44,10 +44,10 @@ header #logo { min-width: 400px; } -.silence .delete-button { +.silence .delete-button, .alert-item .silence-button { opacity: 0.2; } -.silence:hover .delete-button { +.silence:hover .delete-button, .alert-item:hover .silence-button { opacity: 1.0; } @@ -76,6 +76,10 @@ header #logo { margin-bottom: 24px; } +.alert-item .silence-alert { + padding: 1em 2em; +} + .list-item { background: #fff; margin-bottom: 1px; diff --git a/ui/app/js/app.js b/ui/app/js/app.js index 7a5882b1..121bf626 100644 --- a/ui/app/js/app.js +++ b/ui/app/js/app.js @@ -207,6 +207,9 @@ angular.module('am.controllers').controller('AlertCtrl', }); }, $scope.silence.matchers); + $scope.$on('silence-created', function(evt) { + $scope.toggleSilenceForm(); + }); } ); @@ -231,12 +234,12 @@ angular.module('am.controllers').controller('AlertsCtrl', ); angular.module('am.controllers').controller('SilenceCtrl', - function($scope, $rootScope, Silence) { + function($scope, Silence) { $scope.delete = function(sil) { Silence.delete({id: sil.id}, function(data) { - $rootScope.$broadcast('silence-deleted'); + $scope.$emit('silence-deleted'); }, function(data) { $scope.error = data.data; @@ -279,7 +282,7 @@ angular.module('am.controllers').controller('SilencesCtrl', ); angular.module('am.controllers').controller('SilenceCreateCtrl', - function($scope, $rootScope, Silence) { + function($scope, Silence) { $scope.error = null; $scope.silence = $scope.silence || {}; @@ -320,7 +323,7 @@ angular.module('am.controllers').controller('SilenceCreateCtrl', $scope.create = function() { Silence.create($scope.silence, function(data) { - $rootScope.$broadcast('silence-created'); + $scope.$emit('silence-created'); $scope.reset(); }, function(data) { diff --git a/ui/app/partials/alert.html b/ui/app/partials/alert.html index 26b82f82..f4528483 100644 --- a/ui/app/partials/alert.html +++ b/ui/app/partials/alert.html @@ -7,12 +7,12 @@
- +
-
- +
+