Sha256: 5feae8c9d98b133c62d0225a8b4be57d505526cfd365798d1e8effb1ec1aa120
Contents?: true
Size: 864 Bytes
Versions: 28
Compression:
Stored size: 864 Bytes
Contents
pageflow.widgetSubject = { initialize: function() { this.widgets = pageflow.WidgetsCollection.createForSubject(this); if (this.autoSaveWidgets) { this.listenTo(this.widgets, 'change:type_name', function() { this.saveWidgets(); }); } }, widgetsUrlRoot: function() { return '/editor/subjects/' + this.collectionName + '/' + this.id; }, fetchWidgets: function() { this.widgets.fetch(); }, saveWidgets: function(options) { var model = this; return Backbone.sync('patch', model, _.extend(options || {}, { url: this.widgetsUrlRoot() + '/widgets/batch', attrs: { widgets: model.widgets.map(function(widget) { return widget.toJSON(); }) }, success: function(response) { model.trigger('sync:widgets', model, response, {}); } })); } };
Version data entries
28 entries across 28 versions & 1 rubygems