updated default handling to user proper backbone model handling

pull/210/head
Justin Richer 2012-08-20 16:49:39 -04:00
parent 74b4fab58c
commit 6cb7e74046
1 changed files with 15 additions and 5 deletions

View File

@ -398,8 +398,11 @@
var client = new ClientModel();
// set up this new client to require a secret and have us autogenerate one
client.requireClientSecret = true;
client.generateClientSecret = true;
client.set({
requireClientSecret:true,
generateClientSecret:true,
displayClientSecret:false
}, { silent: true });
this.clientFormView = new ClientFormView({model:client});
$('#content').html(this.clientFormView.render().el);
@ -408,11 +411,18 @@
editClient:function(id) {
var client = this.clientList.get(id);
if (client.clientSecret == null) {
client.requireClientSecret = false;
if (client.get("clientSecret") == null) {
client.set({
requireClientSecret:false
}, { silent: true });
}
client.set({
generateClientSecret:false,
displayClientSecret:false
}, { silent: true });
this.clientFormView = new ClientFormView({model:client});
$('#content').html(this.clientFormView.render().el);
this.clientFormView.postRender(); // set up the form for the given model data