Sha256: 105d447167467f3f4241cea2763efbe262c450dd9781400da5098365f4311e4c

Contents?: true

Size: 999 Bytes

Versions: 11

Compression:

Stored size: 999 Bytes

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================
module("SC.View - Keyboard support");

test("Views only attempt to call performKeyEquivalent on child views that support it", function() {
  var performKeyEquivalentCalled = 0;

  var view = SC.View.design({
    childViews: ['unsupported', 'supported'],

    unsupported: SC.CoreView,
    supported: SC.View.design({
      performKeyEquivalent: function(str) {
        performKeyEquivalentCalled++;
        return NO;
      }
    })
  });

  view = view.create();
  view.performKeyEquivalent("ctrl_r");
  
  ok(performKeyEquivalentCalled > 0, "performKeyEquivalent is called on the view that supports it");
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sproutcore-1.6.0.beta.3-x86-mingw32 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js
sproutcore-1.6.0.beta.3-java lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js
sproutcore-1.6.0.beta.3 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js
sproutcore-1.6.0.beta.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js
sproutcore-1.6.0.beta.2-java lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js
sproutcore-1.6.0.beta.2 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js
sproutcore-1.6.0.beta.1 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js
sproutcore-1.5.0-java lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js
sproutcore-1.5.0 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js
sproutcore-1.5.0.rc.2 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js
sproutcore-1.5.0.rc.1 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js