Sha256: 8301614e3d5699a536304da30fc62fb05440e57fd71b3d8a7c81f1b66cf5df69

Contents?: true

Size: 1.29 KB

Versions: 9

Compression:

Stored size: 1.29 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 */

sc_require('states/ready');

/**
  Show loading indicator.
*/
TestRunner.READY_LOADING = SC.Responder.create({

  nextResponder: TestRunner.READY,
  
  /**
    Show loading tests view after 100msec
  */
  didBecomeFirstResponder: function() {
    this._timer = this.invokeLater(this._showTestsLoading, 150);
  },
  
  _showTestsLoading: function() {
    this._timer = null ;
    TestRunner.set('currentScene', 'testsLoading');
  },
  
  willLoseFirstResponder: function() {
    if (this._timer) this._timer.invalidate();
    TestRunner.set('currentScene', null);
  },
  
  testsDidChange: function(sender) {
    var tests = TestRunner.testsController;
    if (tests.get('state') !== SC.Record.READY) return ;
    
    if (tests.get('length')===0) {
      TestRunner.makeFirstResponder(TestRunner.READY_NO_TESTS);
    } else TestRunner.makeFirstResponder(TestRunner.READY_LIST);
  }
  
});

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090720093355 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutit-sproutcore-1.0.0.20090720202429 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutit-sproutcore-1.0.0.20090721125122 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutit-sproutcore-1.0.126 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutit-sproutcore-1.0.20090721145251 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutit-sproutcore-1.0.20090721145280 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutit-sproutcore-1.0.20090721145281 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutit-sproutcore-1.0.20090721145282 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutit-sproutcore-1.0.203 frameworks/sproutcore/apps/tests/states/ready_loading.js