Mixin: SC.SplitThumb

A SplitThumb may be placed inside any view in a SplitView, and can even be a direct child of the SplitView. It forwards its events to the SplitView to control the movement of a divider or another child of the SplitView.

Using a view that mixes in SplitThumb, you can place a handle that moves the divider anywhere inside the SplitView's view tree.

SplitThumb will automatically choose which divider to move. It's choice will almost always be correct for 2-pane layouts. However, in 3-pane layouts, you may want to adjust the way it chooses.

You can adjust the behavior by setting the movesSibling property to SC.MOVES_NEXT_CHILD or SC.MOVES_PREVIOUS_CHILD. If your ThumbView is inside the middle pane, for instance, this would tell it whether the ThumbView should move the divider to the left, or the divider to the right.

Defined in: split_thumb.js

Field Summary

Class Methods

Field Detail

SC.SplitThumb.movesSibling TYPE

Decides whether an ancestor of this SplitThumb view or one of its siblings is to be moved in response to events.

Usually, you want events to move a divider. If the SplitThumb is inside a view which is not a divider, you probably want to move one of the view's siblings-one that is a divider.

You can tell SC.SplitThumb to:

  • SC.MOVES_AUTOMATIC_CHILD: if the SplitView child is either first or last, moves the adjacent child (likely a divider). Otherwise moves the child itself.

  • SC.MOVES_CHILD: moves the child itself, not one of its siblings. Divider views could use this setting.

  • SC.MOVES_PREVIOUS_CHILD: moves the previous child. For instance, in a two-pane setup, if the SplitThumb is in the rightmost child, this will move the divider between the two children.

  • SC.MOVES_NEXT_CHILD: moves the next child.

Class Method Detail

mouseDown(evt)
Parameters:
evt
mouseDragged(evt)
Parameters:
evt
mouseUp(evt)
Parameters:
evt
movesChild()

The child which should be moved by any mouse or touch events. Should usually be a divider view.

The default implementation calculates the child by first finding the ancestor of this view that is a direct child of the SplitView, and then either returning it or one of its immediate siblings, depending on the value of the movesSibling property.

splitCursorStyle()

The name of the CSS cursor that should be used for splitting. The containing SplitView will adopt this cursor if and when this view is dragged.

Computed based on the SplitView's layoutDirection.

splitCursorStyleDidChange()
touchEnd(touch)
Parameters:
touch
touchesDragged(evt)
Parameters:
evt
touchStart(touch)
Parameters:
touch
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:21 GMT-0600 (CST)