Sha256: cc7edabd47f4d2846c9bad6ded892cc438c2e4436350ba26774419e08d25753c

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

// ==========================================================================
// Project:   Greenhouse.targetsController
// Copyright: ©2009 Mike Ball
// ==========================================================================
/*globals Greenhouse */

/** @class

  The full set of targets available in the application.  This is populated 
  automatically when you call loadTargets().
  
  
  This Class comes from SproutCore's test runner
  
  
  @extends SC.ArrayController
*/

Greenhouse.targetsController = SC.ArrayController.create(
/** @scope Greenhouse.targetsController.prototype */ {

  /**
    Call this method whenever you want to relaod the targets from the server.
  */
  reload: function() {
    var targets = Greenhouse.store.find(Greenhouse.TARGETS_QUERY);
    this.set('content', targets);
  },
  
  /** 
    Generates the Array of Apps in this project
  */
  applications: function() {

    var apps = [];
    this.forEach(function(target) { 
      if(target.get('sortKind') === "app") apps.pushObject(target);
    }, this);

    return apps;
    
  }.property('[]').cacheable()
}) ;

Version data entries

7 entries across 7 versions & 1 rubygems

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