Sha256: 8f1c46254db4e9e2f165d11e7a6e2b78859102da77fa769e230609d180f7d12c

Contents?: true

Size: 1.29 KB

Versions: 16

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('status') & SC.Record.READY)) return NO ;
    
    if (tests.get('length')===0) {
      TestRunner.makeFirstResponder(TestRunner.READY_NO_TESTS);
    } else TestRunner.makeFirstResponder(TestRunner.READY_LIST);
  }
  
});

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sproutcore-1.0.1046 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1043 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1042 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1037 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1035 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1031 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1030 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1029 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1027 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1028 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1026 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1025 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1024 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1009 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1008 frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.0.1003 frameworks/sproutcore/apps/tests/states/ready_loading.js