Sha256: cc9bbf3cfc7d46565f43c38c44198f716083fa7c79a2c543f8582a60b350351f
Contents?: true
Size: 823 Bytes
Versions: 12
Compression:
Stored size: 823 Bytes
Contents
pageflow.ChapterPagesCollection = pageflow.SubsetCollection.extend({ mixins: [pageflow.orderedCollection], constructor: function(options) { var chapter = options.chapter; pageflow.SubsetCollection.prototype.constructor.call(this, { parent: options.pages, parentModel: chapter, filter: function(item) { return item.get('chapter_id') === chapter.id; }, comparator: function(item) { return item.get('position'); } }); this.each(function(page) { page.chapter = chapter; }); this.listenTo(this, 'add', function(model) { model.chapter = chapter; }); this.listenTo(this, 'remove', function(model) { model.chapter = null; }); this.listenTo(chapter, 'destroy', function() { this.clear(); }); } });
Version data entries
12 entries across 12 versions & 1 rubygems