Add toggling for silence form

This commit is contained in:
Fabian Reinartz 2015-11-09 15:19:22 +01:00
parent 83c4d596bc
commit 5f46042dd5
2 changed files with 16 additions and 3 deletions

View File

@ -226,6 +226,13 @@ angular.module('am.controllers').controller('SilencesCtrl',
$scope.silences = [];
$scope.order = "endsAt";
$scope.showForm = false;
$scope.toggleForm = function() {
$scope.showForm = !$scope.showForm
}
$scope.refresh = function() {
Silence.query({},
function(data) {

View File

@ -1,6 +1,12 @@
<silence-form sil="silence"></silence-form>
<hr>
<div class="group">
<div class="right">
<button ng-hide="showForm" type="primary" ng-click="toggleForm()" small>New Silence</button>
<button ng-show="showForm" type="primary" ng-click="toggleForm()" small>Hide Form</button>
</div>
<div ng-show="showForm">
<silence-form sil="silence"></silence-form>
</div>
</div>
<div id="silences-query" class="forms">
<row>