Sha256: fcf5b18385bb69a040f0adb454592594887045729e8df945a6e2d533c2f6ba0e

Contents?: true

Size: 1.54 KB

Versions: 17

Compression:

Stored size: 1.54 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
//            Portions ©2008-2009 Apple Inc. All rights reserved.
// License:   Licened 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();
  }
    
});

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.20090721145285 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1046 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1043 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1042 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1037 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1035 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1031 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1030 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1029 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1027 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1028 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1026 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1025 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1024 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1009 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1008 frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.0.1003 frameworks/sproutcore/frameworks/desktop/views/thumb.js