got rid of postrender

pull/263/head
Justin Richer 2012-11-19 16:13:16 -05:00
parent 5b0c17c5de
commit e303319701
1 changed files with 19 additions and 26 deletions

View File

@ -446,11 +446,11 @@
}, },
previewLogo:function(event) { previewLogo:function(event) {
if ($('#logoUrl input').val()) { if ($('#logoUrl input', this.el).val()) {
$('#logoPreview').empty(); $('#logoPreview', this.el).empty();
$('#logoPreview').attr('src', $('#logoUrl input').val()); $('#logoPreview', this.el).attr('src', $('#logoUrl input').val());
} else { } else {
$('#logoBlock').hide(); $('#logoBlock', this.el).hide();
} }
}, },
@ -460,14 +460,14 @@
*/ */
toggleRequireClientSecret:function(event) { toggleRequireClientSecret:function(event) {
if ($('#requireClientSecret input').is(':checked')) { if ($('#requireClientSecret input', this.el).is(':checked')) {
// client secret is required, show all the bits // client secret is required, show all the bits
$('#clientSecretPanel').show(); $('#clientSecretPanel', this.el).show();
// this function sets up the display portions // this function sets up the display portions
this.toggleGenerateClientSecret(); this.toggleGenerateClientSecret();
} else { } else {
// no client secret, hide all the bits // no client secret, hide all the bits
$('#clientSecretPanel').hide(); $('#clientSecretPanel', this.el).hide();
} }
}, },
@ -477,15 +477,15 @@
*/ */
toggleGenerateClientSecret:function(event) { toggleGenerateClientSecret:function(event) {
if ($('#generateClientSecret input').is(':checked')) { if ($('#generateClientSecret input', this.el).is(':checked')) {
// show the "generated" block, hide the "display" checkbox // show the "generated" block, hide the "display" checkbox
$('#displayClientSecret').hide(); $('#displayClientSecret', this.el).hide();
$('#clientSecret').hide(); $('#clientSecret', this.el).hide();
$('#clientSecretGenerated').show(); $('#clientSecretGenerated', this.el).show();
$('#clientSecretHidden').hide(); $('#clientSecretHidden', this.el).hide();
} else { } else {
// show the display checkbox, fall back to the "display" logic // show the display checkbox, fall back to the "display" logic
$('#displayClientSecret').show(); $('#displayClientSecret', this.el).show();
this.toggleDisplayClientSecret(event); this.toggleDisplayClientSecret(event);
} }
}, },
@ -498,14 +498,14 @@
if ($('#displayClientSecret input').is(':checked')) { if ($('#displayClientSecret input').is(':checked')) {
// want to display it // want to display it
$('#clientSecret').show(); $('#clientSecret', this.el).show();
$('#clientSecretHidden').hide(); $('#clientSecretHidden', this.el).hide();
$('#clientSecretGenerated').hide(); $('#clientSecretGenerated', this.el).hide();
} else { } else {
// want to hide it // want to hide it
$('#clientSecret').hide(); $('#clientSecret', this.el).hide();
$('#clientSecretHidden').show(); $('#clientSecretHidden', this.el).show();
$('#clientSecretGenerated').hide(); $('#clientSecretGenerated', this.el).hide();
} }
}, },
@ -640,11 +640,6 @@
$("#id-token-timeout-seconds", this.$el).prop('disabled',true); $("#id-token-timeout-seconds", this.$el).prop('disabled',true);
} }
return this;
},
postRender:function() {
this.toggleRequireClientSecret(); this.toggleRequireClientSecret();
this.previewLogo(); this.previewLogo();
} }
@ -1073,7 +1068,6 @@
this.clientFormView = new ClientFormView({model:client}); this.clientFormView = new ClientFormView({model:client});
$('#content').html(this.clientFormView.render().el); $('#content').html(this.clientFormView.render().el);
this.clientFormView.postRender(); // set up the form for the given model data
}, },
editClient:function(id) { editClient:function(id) {
@ -1100,7 +1094,6 @@
this.clientFormView = new ClientFormView({model:client}); this.clientFormView = new ClientFormView({model:client});
$('#content').html(this.clientFormView.render().el); $('#content').html(this.clientFormView.render().el);
this.clientFormView.postRender(); // set up the form for the given model data
}, },
whiteList:function () { whiteList:function () {