Protocol: SC.DragSource

The DragSource protocol is used to dynamically generate multiple types of data from a single object. You must implement this protocol if you want to provide the data for a drag event.

Defined in: drag_source.js

Field Summary

Class Methods

Field Detail

SC.DragSource.ignoreModifierKeysWhileDragging Boolean

If this property is set to NO or is not implemented, then the user may modify the drag operation by changing the modifier keys they have pressed.

Default value:
NO

Class Method Detail

dragDidBegin(drag, loc)

This method is called when the drag begins. You can use this to do any visual highlighting to indicate that the receiver is the source of the drag.

Parameters:
drag SC.Drag
The Drag instance managing this drag.
loc Point
The point in *window* coordinates where the drag began. You can use convertOffsetFromView() to convert this to local coordinates.
dragDidEnd(drag, loc, op)

This method is called when the drag ended. You can use this to do any cleanup. The operation is the actual operation performed on the drag.

Parameters:
drag SC.Drag
The drag instance managing the drag.
loc Point
The point in WINDOW coordinates where the drag ended.
op DragOp
The drag operation that was performed. One of SC.DRAG_COPY, SC.DRAG_MOVE, SC.DRAG_LINK, or SC.DRAG_NONE.
dragDidMove(drag, loc)

This method is called whenever the drag image is moved. This is similar to the dragUpdated() method called on drop targets.

Parameters:
drag SC.Drag
The Drag instance managing this drag.
loc Point
The point in *window* coordinates where the drag mouse is. You can use convertOffsetFromView() to convert this to local coordinates.
dragSourceOperationMaskFor(dropTarget, drag)

This method must be overridden for drag operations to be allowed. Return a bitwise OR'd mask of the drag operations allowed on the specified target. If you don't care about the target, just return a constant value.

The default implementation returns SC.DRAG_NONE

Parameters:
dropTarget SC.View
The proposed target of the drop.
drag SC.Drag
The SC.Drag instance managing this drag.
Documentation generated by JsDoc Toolkit 2.4.0 on Sun Oct 27 2013 19:58:51 GMT-0600 (CST)