Sha256: 936217a78e3c13c18dabc00502bf72bc5221d16823fba48f98868c7b5e440782
Contents?: true
Size: 809 Bytes
Versions: 6
Compression:
Stored size: 809 Bytes
Contents
pageflow.PagesCollection = Backbone.Collection.extend({ model: pageflow.Page, url: '/pages', comparator: function(pageA, pageB) { if (pageA.storylinePosition() > pageB.storylinePosition()) { return 1; } else if (pageA.storylinePosition() < pageB.storylinePosition()) { return -1; } else if (pageA.chapterPosition() > pageB.chapterPosition()) { return 1; } else if (pageA.chapterPosition() < pageB.chapterPosition()) { return -1; } else if (pageA.get('position') > pageB.get('position')) { return 1; } else if (pageA.get('position') < pageB.get('position')) { return -1; } else { return 0; } }, getByPermaId: function(permaId) { return this.findWhere({perma_id: parseInt(permaId, 10)}); } });
Version data entries
6 entries across 6 versions & 1 rubygems