1 // ==========================================================================
  2 // Project:   SproutCore - JavaScript Application Framework
  3 // Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
  4 //            Portions ©2008-2011 Apple Inc. All rights reserved.
  5 // License:   Licensed under MIT license (see license.js)
  6 // ==========================================================================
  7 
  8 sc_require('mixins/split_child');
  9 sc_require('mixins/split_thumb');
 10 
 11 /**
 12   @class
 13 
 14   A SplitDividerView sits between any two other views in a SplitView.
 15   The SplitDivider mixes in SC.SplitThumb to allow the user to drag
 16   it around. The dragging process will cause SC.SplitView to adjust
 17   other children as needed.
 18 
 19   @extends SC.View
 20   @author Alex Iskander
 21 */
 22 SC.SplitDividerView = SC.View.extend(SC.SplitChild, SC.SplitThumb,
 23 /** @scope SC.SplitDividerView.prototype */ {
 24 
 25   /** @private */
 26   classNames: ['sc-split-divider-view'],
 27 
 28   /** @private */
 29   classNameBindings: ['layoutDirection'],
 30   
 31   /**
 32     Walks like a duck. Used and maintained by SC.SplitView to keep track
 33     of which of its childViews are dividers.
 34 
 35     @type Boolean
 36   */
 37   isSplitDivider: YES,
 38 
 39   /**
 40     The layout direction of the parent SplitView. May be SC.LAYOUT_VERTICAL
 41     or SC.LAYOUT_HORIZONTAL. This property is also added as a class on this
 42     view.
 43     
 44     You generally will not set this property yourself; it is managed by the
 45     parent SplitView.
 46 
 47     @type String
 48     @default SC.LAYOUT_HORIZONTAL
 49    */
 50   layoutDirection: SC.LAYOUT_HORIZONTAL,
 51 
 52   /** @private
 53     This indicates that the view should not resize while being dragged; this
 54     is generally the desired behavior.
 55 
 56     (NOTE: SC.FIXED_SIZE is hard-coded here. It is defined on SC.SplitView,
 57     which requires this file.)
 58    */
 59   autoResizeStyle: 'sc-fixed-size',
 60 
 61   movesSibling: SC.MOVES_CHILD,
 62   
 63   size: SC.propertyFromRenderDelegate('dividerSize', 10),
 64 
 65   renderDelegateName: 'splitDividerRenderDelegate'
 66 });
 67