Sha256: fad5843320101a6dd61d7837375242e6cfd3fe5d56c8de6afc1678c75cc4f0b9

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

// ==========================================================================
// Project:   Greenhouse.targetsController
// Copyright: ©2010 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 reload 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

6 entries across 6 versions & 1 rubygems

Version Path
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/targets.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/targets.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/targets.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/targets.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/targets.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/targets.js