Add toggling for silence form
This commit is contained in:
parent
83c4d596bc
commit
5f46042dd5
|
@ -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) {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue