dns ui: add collapse button

This commit is contained in:
Girish Ramakrishnan
2016-07-03 08:28:31 -05:00
parent d259a3f326
commit 2e2b75bab2
2 changed files with 8 additions and 2 deletions

View File

@@ -45,6 +45,8 @@
<input type="text" class="form-control" ng-model="dnsCredentials.secretAccessKey" id="dnsCredentialsSecretAccessKey" name="secretAccessKey" ng-disabled="dnsCredentials.busy" required>
</div>
<a href="" class="pull-left" ng-click="hideDnsCredentialsForm()">Collapse</a>
<button type="submit" class="btn btn-outline btn-success pull-right" ng-disabled="dnsCredentialsForm.$invalid || busy"><i class="fa fa-spinner fa-pulse" ng-show="dnsCredentials.busy"></i> Save</button>
</fieldset>
</form>

View File

@@ -93,6 +93,11 @@ angular.module('Application').controller('CertsController', ['$scope', '$locatio
});
};
$scope.hideDnsCredentialsForm = function () {
$('#collapseDnsCredentialsForm').collapse('hide');
$scope.dnsCredentials.formVisible = false;
};
$scope.setDnsCredentials = function () {
$scope.dnsCredentials.busy = true;
$scope.dnsCredentials.error = null;
@@ -116,8 +121,7 @@ angular.module('Application').controller('CertsController', ['$scope', '$locatio
$scope.dnsCredentials.accessKeyId = '';
$scope.dnsCredentials.secretAccessKey = '';
$('#collapseDnsCredentialsForm').collapse('hide');
$scope.dnsCredentials.formVisible = false;
$scope.hideDnsCredentialsForm();
// attempt to reload to make the browser get the new certs
window.location.reload(true);