Sha256: 90ddb51912c34e7a1c9952d313282e9f0759e5d2f73a02b8b10e64a46e8d4084

Contents?: true

Size: 1.29 KB

Versions: 30

Compression:

Stored size: 1.29 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed 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

30 entries across 30 versions & 1 rubygems

Version Path
sproutcore-1.9.2 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.9.1 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.9.0 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.8.1 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.8.0 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0.1 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0.1-x86-mingw32 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0-java lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0.rc.2-x86-mingw32 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0.rc.2 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0.rc.2-java lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0.rc.1-x86-mingw32 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0.rc.1 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0.rc.1-java lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.6.0.beta.3-x86-mingw32 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js