PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/js/collection/gallery.js

https://github.com/onesime/game
JavaScript | 25 lines | 17 code | 7 blank | 1 comment | 1 complexity | a2673313fe02d419a1019935d9238b4d MD5 | raw file
  1. // Collection
  2. var hetic = hetic || {};
  3. (function(){
  4. "use strict";
  5. var Gallery = Backbone.Collection.extend({
  6. model: hetic.Student,
  7. initialize: function(){
  8. this.on('add', this.render);
  9. },
  10. render: function(model){
  11. $("#student-list").prepend( model.view.render().el );
  12. }
  13. });
  14. hetic.gallery = new Gallery();
  15. hetic.gallery.create({firstname: 'Anthony', lastname: 'Zaccardi', image: 'img/zaccardi.png', promotion: 2015, website:"http://www.anthonyzaccardi.com/", capacities: ['html']});
  16. hetic.gallery.create({firstname: 'Arnaud', lastname: 'Pichon', image: 'img/arnaud.png', promotion: 2015, website:"http://www.onesime.fr", capacities: ['html', 'backbone']});
  17. hetic.gallery.create({firstname: 'Mathieu', lastname: 'Dutto', image: 'img/mathieu.jpg', promotion: 2015, website:"http://www.mathieudutto.fr", capacities: ['html', 'css', 'php']});
  18. }());