Sha256: 68977625c27557b3cfc9d96559fff86c2f2cbd31fc5ba3ceb912253fc3edd1cf
Contents?: true
Size: 720 Bytes
Versions: 85
Compression:
Stored size: 720 Bytes
Contents
pageflow.OtherEntriesCollection = Backbone.Collection.extend({ model: pageflow.OtherEntry, url: '/editor/entries', initialize: function(models, options) { options = options || {}; this.excludeEntry = options.excludeEntry; }, // override parse method to exclude the entry being edited. This is the collection // of the "other" entries, after all. parse: function(response) { var excludeEntry = this.getExcludeEntry(), filteredResponse = _.filter(response, function(entry){ return entry.id != excludeEntry.id; }); return Backbone.Collection.prototype.parse.call(this, filteredResponse); }, getExcludeEntry: function() { return this.excludeEntry || pageflow.entry; } });
Version data entries
85 entries across 85 versions & 1 rubygems