Sha256: 7728add6b31758cb0444ce799d1cfb2f5814cb37e6e93ad965d3fa3c5258ad78
Contents?: true
Size: 927 Bytes
Versions: 16
Compression:
Stored size: 927 Bytes
Contents
pageflow.Widget = Backbone.Model.extend({ paramRoot: 'widget', i18nKey: 'pageflow/widget', initialize: function(attributes, options) { this.widgetTypes = options.widgetTypes; this.configuration = new pageflow.WidgetConfiguration( this.get('configuration') || {} ); this.listenTo(this.configuration, 'change', function() { this.trigger('change:configuration', this); }); }, widgetType: function() { return this.get('type_name') && this.widgetTypes.findByName(this.get('type_name')); }, hasConfiguration: function() { return !!(this.widgetType() && this.widgetType().hasConfiguration()); }, role: function() { return this.id; }, urlRoot: function() { return this.collection.url(); }, toJSON: function() { return { role: this.role(), type_name: this.get('type_name'), configuration: this.configuration.toJSON() }; }, });
Version data entries
16 entries across 16 versions & 1 rubygems