Sha256: cd43424b5eaaa76f0e88c03f6eefcc97e5f578137907c4f095161ea4111a93d0

Contents?: true

Size: 1.42 KB

Versions: 7

Compression:

Stored size: 1.42 KB

Contents

// ==========================================================================
// Project:   Greenhouse.ViewConfig
// Copyright: ©2010 My Company, Inc.
// ==========================================================================
/*globals Greenhouse js_beautify*/

/** @class

  (Document your Model here)

  @extends SC.Record
  @version 0.1
*/
Greenhouse.ViewConfig = SC.Record.extend(
/** @scope Greenhouse.ViewConfig.prototype */ {
  
  primaryKey: 'path',
  
  views: SC.Record.toMany('Greenhouse.Design', {nested: YES}),
  panes: SC.Record.toMany('Greenhouse.Design', {nested: YES}),
  controllers: SC.Record.toMany('Greenhouse.Design', {nested: YES}),
  canEdit: SC.Record.attr(Boolean),
  name: SC.Record.attr(String),
  path: SC.Record.attr(String),
  
  body: function(){
    var ret = {name: this.get('name'), path: this.get('path'), views: [], controllers: [], panes: []},
        views = this.get('views'),
        controllers = this.get('controllers'),
        panes = this.get('panes');
    
    
    views.forEach(function(i){
      ret.views.push(i.get('attributes'));
    });
    
    controllers.forEach(function(i){
      ret.controllers.push(i.get('attributes'));
    });
    
    panes.forEach(function(i){
      ret.panes.push(i.get('attributes'));
    });
    
    return js_beautify(SC.json.encode(ret));
  }.property('views', 'panes', 'controllers')
  
}) ;
Greenhouse.CONFIG_QUERY = SC.Query.remote(Greenhouse.ViewConfig);

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sproutcore-1.4.0.rc.5 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.4.0.rc.4 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.4.0.rc.3 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.4.0.rc.2 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.4.0.rc lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.0.1049.pre.2 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.0.1049.pre.1 frameworks/sproutcore/apps/greenhouse/models/view_config.js