UI silencing on alert items fixed

This commit is contained in:
Fabian Reinartz 2015-11-06 17:35:37 +01:00
parent a3dc8fb36e
commit 7be65952e3
3 changed files with 16 additions and 9 deletions

View File

@ -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;

View File

@ -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) {

View File

@ -7,12 +7,12 @@
</span>
<div class="right">
<button type="secondary" ng-click="toggleSilenceForm()" small>Silence</button>
<button class="silence-button" type="secondary" ng-click="toggleSilenceForm()" small upper>Silence</button>
</div>
</div>
<div>
<silence-form ng-show="showSilenceForm" silence="silence"></silence-form>
<div class="silence-alert" ng-show="showSilenceForm">
<silence-form silence="silence"></silence-form>
</div>
<div class="detail group">