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.silences = [];
$scope.order = "endsAt"; $scope.order = "endsAt";
$scope.showForm = false;
$scope.toggleForm = function() {
$scope.showForm = !$scope.showForm
}
$scope.refresh = function() { $scope.refresh = function() {
Silence.query({}, Silence.query({},
function(data) { function(data) {

View File

@ -1,6 +1,12 @@
<silence-form sil="silence"></silence-form> <div class="group">
<div class="right">
<hr> <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"> <div id="silences-query" class="forms">
<row> <row>