Sha256: 723fe281e76c6bb9bcc14d33e06459d92d6220dd92ce654671a2a25750d939db
Contents?: true
Size: 966 Bytes
Versions: 30
Compression:
Stored size: 966 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.configuration.parent = this; 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
30 entries across 30 versions & 1 rubygems