From 86c6a0ea8b2c9708177a71d5e93ffe90d7675a3d Mon Sep 17 00:00:00 2001 From: William Kim Date: Thu, 15 Aug 2013 13:09:53 -0400 Subject: [PATCH] clear token timeout form fields when disabled and also disable unit selector. --- .../src/main/webapp/resources/js/client.js | 18 +++++++++++++++--- .../main/webapp/resources/template/client.html | 6 +++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/openid-connect-server/src/main/webapp/resources/js/client.js b/openid-connect-server/src/main/webapp/resources/js/client.js index 5661a8a98..18a2352f4 100644 --- a/openid-connect-server/src/main/webapp/resources/js/client.js +++ b/openid-connect-server/src/main/webapp/resources/js/client.js @@ -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", diff --git a/openid-connect-server/src/main/webapp/resources/template/client.html b/openid-connect-server/src/main/webapp/resources/template/client.html index d10bd4c45..17b978a78 100644 --- a/openid-connect-server/src/main/webapp/resources/template/client.html +++ b/openid-connect-server/src/main/webapp/resources/template/client.html @@ -362,7 +362,7 @@
- @@ -383,7 +383,7 @@
- @@ -416,7 +416,7 @@
-