clear token timeout form fields when disabled and also disable unit selector.

pull/477/head
William Kim 11 years ago
parent 3f01ae1a71
commit 86c6a0ea8b

@ -288,9 +288,21 @@ var ClientFormView = Backbone.View.extend({
events:{
"click .btn-save":"saveClient",
"click #allowRefresh" : "toggleRefreshTokenTimeout",
"click #disableAccessTokenTimeout" : function(){ $("#access-token-timeout-time", this.$el).prop('disabled',!$("#access-token-timeout-time", this.$el).prop('disabled')); },
"click #disableIDTokenTimeout" : function(){ $("#id-token-timeout-time", this.$el).prop('disabled',!$("#id-token-timeout-time", this.$el).prop('disabled')); },
"click #disableRefreshTokenTimeout" : function(){ $("#refresh-token-timeout-time", this.$el).prop('disabled',!$("#refresh-token-timeout-time", this.$el).prop('disabled')); },
"click #disableAccessTokenTimeout" : function() {
$("#access-token-timeout-time", this.$el).prop('disabled',!$("#access-token-timeout-time", this.$el).prop('disabled'));
$("#access-token-timeout-unit", this.$el).prop('disabled',!$("#access-token-timeout-unit", this.$el).prop('disabled'));
document.getElementById("access-token-timeout-time").value = '';
},
"click #disableIDTokenTimeout" : function() {
$("#id-token-timeout-time", this.$el).prop('disabled',!$("#id-token-timeout-time", this.$el).prop('disabled'));
$("#id-token-timeout-unit", this.$el).prop('disabled',!$("#id-token-timeout-unit", this.$el).prop('disabled'));
document.getElementById("id-token-timeout-time").value = '';
},
"click #disableRefreshTokenTimeout" : function() {
$("#refresh-token-timeout-time", this.$el).prop('disabled',!$("#refresh-token-timeout-time", this.$el).prop('disabled'));
$("#refresh-token-timeout-unit", this.$el).prop('disabled',!$("#refresh-token-timeout-unit", this.$el).prop('disabled'));
document.getElementById("refresh-token-timeout-time").value = '';
},
"click .btn-cancel": function() { window.history.back(); return false; },
"change #requireClientSecret":"toggleRequireClientSecret",
"change #displayClientSecret":"toggleDisplayClientSecret",

@ -362,7 +362,7 @@
</div>
<div class="form-horizontal">
<input type="text" class="" value="<%=(accessTokenValiditySeconds == null ? '' : accessTokenValiditySeconds)%>" id="access-token-timeout-time" size="16" style="width:120px;">
<select style="width:120px;">
<select id="access-token-timeout-unit" style="width:120px;">
<option>seconds</option>
<option>minutes</option>
<option>hours</option>
@ -383,7 +383,7 @@
</div>
<div class="form-horizontal">
<input type="text" class="" value="<%=(idTokenValiditySeconds == null ? '' : idTokenValiditySeconds)%>" id="id-token-timeout-time" size="16" style="width:120px;">
<select style="width:120px;">
<select id="id-token-timeout-unit" style="width:120px;">
<option>seconds</option>
<option>minutes</option>
<option>hours</option>
@ -416,7 +416,7 @@
</div>
<div class="form-horizontal">
<input type="text" class="" value="<%=(refreshTokenValiditySeconds == null ? '' : refreshTokenValiditySeconds)%>" id="refresh-token-timeout-time" size="16" style="width:120px;">
<select style="width:120px;">
<select id="refresh-token-timeout-unit" style="width:120px;">
<option>seconds</option>
<option>minutes</option>
<option>hours</option>

Loading…
Cancel
Save