Sha256: 61ed667dc5da68568599e7d262a0804c27e4d981e492147ada699b4a907220e4

Contents?: true

Size: 1.77 KB

Versions: 29

Compression:

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

/**
  @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 */ {

  /**
    @type Array
    @default ['sc-thumb-view']
    @see SC.View#classNames
  */
  classNames: ['sc-thumb-view'],
  
  /**
    Enable this thumb view to control its parent split view.
    
    @type Boolean
    @default YES
  */
  isEnabled: YES,
  
  /** @private */
  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() ;
  },
  
  /** @private */
  mouseDown: function(evt) {
    if (!this.get('isEnabled')) return NO ;
    
    var splitView = this.get('splitView');
    return (splitView) ? splitView.mouseDownInThumbView(evt, this) : sc_super();
  },
  
  /** @private */
  touchStart: function(evt) {
    return this.mouseDown(evt);
  }

});

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0.1 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0-java lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0.rc.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0.rc.2 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0.rc.2-java lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0.rc.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0.rc.1 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0.rc.1-java lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js
sproutcore-1.6.0.beta.3-x86-mingw32 lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js