PageRenderTime 25ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/websocket/scripts/app/client-collection.js

http://skeleton.googlecode.com/
JavaScript | 36 lines | 21 code | 11 blank | 4 comment | 0 complexity | 9573f1b0a08ae1e00122f41dc767efbb MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. $(function(){
  6. window.Client = Backbone.Model.extend({
  7. });
  8. window.ClientList = Backbone.Collection.extend({
  9. model: Client
  10. });
  11. window.ClientView = Backbone.View.extend({
  12. tagName: 'li',
  13. template: _.template($('#client-template').html()),
  14. events: {
  15. 'dblclick li.client' : 'edit'
  16. },
  17. initialize: function () {
  18. _.bindAll(this, 'render', 'close');
  19. this.model.bind('change', this.render);
  20. this.model.view = this;
  21. },
  22. setName: function () {
  23. }
  24. })
  25. })