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