Sha256: 9486a01c729a756c02a007d39791ef05ed4644b8fd6b487c776da9776f74c156

Contents?: true

Size: 1.82 KB

Versions: 24

Compression:

Stored size: 1.82 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)
// ==========================================================================

sc_require('render_delegates/picker');

// This is the same as a pickerRenderDelegate, but is named 'menu' instead.
SC.BaseTheme.menuRenderDelegate = SC.BaseTheme.pickerRenderDelegate.create({
  className: 'menu',

  render: function(orig, dataSource, context) {
    this.addSizeClassName(dataSource, context);
    orig(dataSource, context);
  }.enhance(),

  update: function(orig, dataSource, jquery) {
    this.updateSizeClassName(dataSource, jquery);
    orig(dataSource, jquery);
  }.enhance(),

  // height for items in this menu size
  itemHeight: 20,

  // height of separator items
  itemSeparatorHeight: 9,

  // amount to add to the calculated menu height
  menuHeightPadding: 6,

  // amount to add to any calculated menu width to determine the actual width
  menuWidthPadding: 50,

  minimumMenuWidth: 50,

  submenuOffsetX: 2,
  verticalOffset: 23,

  'sc-tiny-size': {
    itemHeight: 10,
    itemSeparatorHeight: 2,
    menuHeightPadding: 2,
    submenuOffsetX: 0
  },

  'sc-small-size': {
    itemHeight: 16,
    itemSeparatorHeight: 7,
    menuHeightPadding: 4,
    submenuOffsetX: 2
  },

  'sc-large-size': {
    itemHeight: 60,
    itemSeparatorHeight: 20,
    menuHeightPadding: 0,
    submenuOffsetX: 4
  },

  // pretty sure these sizes are wrong, but I copied them from their original
  // values so... please fix.
  'sc-huge-size': {
    itemHeight: 20,
    itemSeparatorHeight: 9,
    menuHeightPadding: 0,
    submenuOffsetX: 0
  }
});

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js