Sha256: f6e6ee677edb52776ba79ffad6b64a106948e1ddec941ad568988c98c86af5d6
Contents?: true
Size: 735 Bytes
Versions: 46
Compression:
Stored size: 735 Bytes
Contents
pageflow.WidgetsCollection = Backbone.Collection.extend({ model: pageflow.Widget, initialize: function() { this.listenTo(this, 'change:type_name change:configuration', function() { this.batchSave(); }); }, url: function() { return '/editor/subjects/entries/' + this.subject.id + '/widgets'; }, batchSave: function(options) { var subject = this.subject; return Backbone.sync('patch', subject, _.extend(options || {}, { url: this.url() + '/batch', attrs: { widgets: this.map(function(widget) { return widget.toJSON(); }) }, success: function(response) { subject.trigger('sync:widgets', subject, response, {}); } })); } });
Version data entries
46 entries across 46 versions & 1 rubygems