Sha256: 99497ad4417682754260e81a4800e08d21357baab85add05322f4b247006cf3b

Contents?: true

Size: 1.29 KB

Versions: 7

Compression:

Stored size: 1.29 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2010 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

7 entries across 7 versions & 2 rubygems

Version Path
spade-0.0.1 sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.5.0.pre.5 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.5.0.pre.4.1 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.5.0.pre.4 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.5.0.pre.3 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.4.5 lib/frameworks/sproutcore/apps/tests/states/ready_loading.js
sproutcore-1.4.5-java lib/frameworks/sproutcore/apps/tests/states/ready_loading.js