Sha256: e428abbd85b86b97ba29cc64b3450e343ddbf990bdcf511428830664eaba5fff

Contents?: true

Size: 1.26 KB

Versions: 13

Compression:

Stored size: 1.26 KB

Contents

// ==========================================================================
// Project:   Welcome.targetsController
// Copyright: ©2010 Apple Inc.
// ==========================================================================
/*globals CoreTools Welcome */

/** @class
  
  Manages the list of targets

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

  /**
    Call this method whenever you want to relaod the targets from the server.
  */
  reload: function() {
    var targets = Welcome.store.find(CoreTools.TARGETS_QUERY);
    this.set('content', targets);
  },
  
  appsOnly: function() {
    return this.filter(function(t) { 
      return (t.get('kind') === 'app') && 
             (t.get('name') !== '/sproutcore/welcome'); 
    });
  }.property('[]').cacheable(),
  
  loadApplication: function() {
    var app = this.get('selection').firstObject(),
        url = app ? app.get('appUrl') : null;
        
    if (url) {
      this.set('canLoadApp', NO);
      this.invokeLater(function() { 
        window.location.href = url; // load new app
      });
    }
  },

  // used to disable all controls
  canLoadApp: YES,
  
  allowsEmptySelection: NO,
  allowsMultipleSelection: NO

}) ;

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sproutcore-1.4.5 lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.5-java lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.4-java lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.4 lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.3.1 lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.3-java lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.3 lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.2-java lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.2 lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.1-java lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.1 lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.0-java lib/frameworks/sproutcore/apps/welcome/controllers/targets.js
sproutcore-1.4.0 lib/frameworks/sproutcore/apps/welcome/controllers/targets.js