Sha256: 1f815eaf2fedc5165db7813e6e540d2ffdbf195219e36c7b218acb41c1e0375a

Contents?: true

Size: 1.35 KB

Versions: 15

Compression:

Stored size: 1.35 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

SC.BaseTheme.scrollRenderDelegate = SC.RenderDelegate.create({
  className: 'scroll',

  render: function (dataSource, context) {
    context.push('<div class="corner"></div>');
  },

  update: function (dataSource, context) {
    var K = 'scrollRenderDelegate',
        thicknessDidChange = dataSource.didChangeFor(K, 'nativeScrollbarThickness'),
        scroll = context.find('> .sc-scroll-container-view'),
        canScroll, thickness = dataSource.get('nativeScrollbarThickness');

    if (thicknessDidChange || dataSource.didChangeFor(K, 'canScrollHorizontal')) {
      canScroll = dataSource.get('canScrollHorizontal');
      scroll.css('margin-bottom', canScroll ? -1 * thickness : 0);
      scroll.css('overflow-x', canScroll ? 'scroll' : 'hidden');
    }

    if (thicknessDidChange || dataSource.didChangeFor(K, 'canScrollVertical')) {
      canScroll = dataSource.get('canScrollVertical');
      scroll.css('margin-right', canScroll ? -1 * thickness : 0);
      scroll.css('overflow-y', canScroll ? 'scroll' : 'hidden');
    }
  }

});

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js