Sha256: 17ede31edac138350a287e3051a2ad2156b37c2d0f53a2640f95da74744c2e2a

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
//            Portions ©2008-2009 Apple Inc. All rights reserved.
// License:   Licened under MIT license (see license.js)
// ==========================================================================
/*globals TestRunner */

/**
  Initial state of application before it has loaded targets.
*/
TestRunner.START = SC.Responder.create({
  
  /**
    Show loading targets view.
  */
  didBecomeFirstResponder: function() {
    TestRunner.set('currentScene', 'targetsLoading');
    TestRunner.targetsController.reload(); // load the targets.
  },
  
  willLoseFirstResponder: function() {
    TestRunner.set('currentScene', null);
  },
  
  /**
    Called when the targets have loaded.  Pass param whether we have targets 
    or not.
  */
  targetsDidChange: function() {
    if (TestRunner.getPath('targets.state') !== SC.Record.READY) return NO;
    
    var hasTargets = TestRunner.getPath('targets.length') >0;
    if (hasTargets) TestRunner.makeFirstResponder(TestRunner.READY_EMPTY);
    else TestRunner.makeFirstResponder(TestRunner.NO_TARGETS);
    return YES;
  }
    
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sproutit-sproutcore-1.0.20090721145285 frameworks/sproutcore/apps/tests/states/start.js