Skip to content

Commit

Permalink
Simpliying examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
efeminella committed Jun 13, 2013
1 parent 0ca462b commit 5b478a5
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions README.md
Expand Up @@ -67,21 +67,17 @@ var UserEditor = Backbone.View.extend({
// also use the 'roles' broker
rolesBroker: Backbone.EventBroker.get('roles'),

initialize: function(broker){
this.$userId = this.$('.user-id');
this.$roleType = this.$('.user-id');
},
addUser: function(evt) {
// publish an event to the usersBroker
this.usersBroker.trigger('add', new User({
'id': this.$userId().val()
'id': this.$('.user-id').val()
//other values ...
}));
},
addRole: function(evt) {
// publish an event to the rolesBroker
this.rolesBroker.trigger('add', new Role({
'type': this.$roleType().val()
'type': this.$('.user-id').val()
}));
}
};
Expand Down Expand Up @@ -116,21 +112,17 @@ var UserEditor = Backbone.View.extend({
// also use the 'roles' broker
rolesBroker: Backbone.EventBroker.get('roles'),

initialize: function(broker){
this.$userId = this.$('.user-id');
this.$roleType = this.$('.user-id');
},
addUser: function(evt) {
// publish an event to the usersBroker
this.usersBroker.trigger('users:add', new User({
'id': this.$userId().val()
'id': this.$('.user-id').val()
//other values ...
}));
},
addRole: function(evt) {
// publish an event to the rolesBroker
this.rolesBroker.trigger('roles:add', new Role({
'type': this.$roleType().val()
'type': this.$('.user-id').val()
}));
}
};
Expand Down

0 comments on commit 5b478a5

Please sign in to comment.