Sha256: 1233ea0a4225c2b1662a78d3f67cb805d79aa04f0cf3a7c4f8a6a6fb0973c468

Contents?: true

Size: 1.6 KB

Versions: 7

Compression:

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

/**
  @class

  A ThumbView works in concert with SC.SplitView to adjust the divider 
  position from an arbitrary subview of the SplitView. Simply make an
  instance of ThumbView a child somewhere in the childViews (or 
  descendants) of the split view and add the path to the ThumbView to the
  SplitView's thumbViews array.
  
  SplitView will automatically set the splitView property of the views in
  its thumbViews array.

  @extends SC.View
  @author Erich Ocean
  @test in split
*/
SC.ThumbView = SC.View.extend(
/** @scope SC.ThumbView.prototype */ {

  classNames: ['sc-thumb-view'],
  
  /**
    Enable this thumb view to control its parent split view.
  */
  isEnabled: YES,
  isEnabledBindingDefault: SC.Binding.bool(),
  
  /** @private */
  prepareContext: function(context, firstTime) {
    var splitView = this.get('splitView') ;
    if (splitView) this.set('cursor', splitView.get('thumbViewCursor')) ;
    return sc_super() ;
  },
  
  mouseDown: function(evt) {
    if (!this.get('isEnabled')) return NO ;
    
    var splitView = this.get('splitView');
    return (splitView) ? splitView.mouseDownInThumbView(evt, this) : sc_super();
  },
  
  touchStart: function(evt) {
    return this.mouseDown(evt);
  }
    
});

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
spade-0.0.1 sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.5.0.pre.5 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.5.0.pre.4.1 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.5.0.pre.4 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.5.0.pre.3 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.4.5 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.4.5-java lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js