PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/client/src/views/contacts.js

https://github.com/robertd/benm
JavaScript | 23 lines | 20 code | 3 blank | 0 comment | 0 complexity | 93fb4dfd778a1917b21b416e613ff015 MD5 | raw file
  1. var Marionette = require('backbone.marionette');
  2. var itemView = Marionette.ItemView.extend({
  3. template: require('../../templates/contact_small.hbs'),
  4. initialize: function() {
  5. this.listenTo(this.model, 'change', this.render);
  6. },
  7. events: {
  8. 'click': 'showDetails'
  9. },
  10. showDetails: function() {
  11. window.App.core.vent.trigger('app:log', 'Contacts View: showDetails hit.');
  12. window.App.controller.details(this.model.id);
  13. }
  14. });
  15. module.exports = CollectionView = Marionette.CollectionView.extend({
  16. initialize: function() {
  17. this.listenTo(this.collection, 'change', this.render);
  18. },
  19. itemView: itemView
  20. });