Sha256: 04fe931040ee3b1e87d695109ad2c5fd1ddd476926f310c405924e58cf35d3b9
Contents?: true
Size: 1.47 KB
Versions: 23
Compression:
Stored size: 1.47 KB
Contents
define( [ 'model/base' ], function( Base ){ /** * DashboardModel * * Generic model that represents a dashboard in rearview. **/ var DashboardModel = Base.extend({ initialize : function(options) { this.category = ( options ) ? options.category : false; this.dashboardId = ( options ) ? options.dashboardId : null; }, url : function() { if ( this.category ) { return ( this.dashboardId ) ? '/dashboards/' + this.dashboardId + '/children.json' : '/dashboards.json'; } else { return ( this.get('id') ) ? '/dashboards/' + this.get('id') : '/dashboards.json'; } }, parse : function(response, options) { response.createdAt = ( response.createdAt ) ? this.formatServerDateTime(response.createdAt) : response.createdAt; response.modifiedAt = ( response.modifiedAt ) ? this.formatServerDateTime(response.modifiedAt) : response.modifiedAt; return response; }, defaults : { 'id' : null, 'userId' : null, 'name' : 'Default', 'createdAt' : null, 'modifiedAt' : null, 'description': null, 'children' : [] } }); return DashboardModel; });
Version data entries
23 entries across 23 versions & 1 rubygems