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
- SC.DragSource.ignoreModifierKeysWhileDragging
Class Methods
Field Detail
Boolean SC.DragSource.ignoreModifierKeysWhileDraggingIf 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
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:
- SC.Drag drag
- The Drag instance managing this drag.
- Point loc
- The point in *window* coordinates where the drag began. You can use convertOffsetFromView() to convert this to local coordinates.
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:
- SC.Drag drag
- The drag instance managing the drag.
- Point loc
- The point in WINDOW coordinates where the drag ended.
- DragOp op
- The drag operation that was performed. One of SC.DRAG_COPY, SC.DRAG_MOVE, SC.DRAG_LINK, or SC.DRAG_NONE.
This method is called whenever the drag image is moved. This is
similar to the dragUpdated() method called on drop targets.
- Parameters:
- SC.Drag drag
- The Drag instance managing this drag.
- Point loc
- The point in *window* coordinates where the drag mouse is. You can use convertOffsetFromView() to convert this to local coordinates.
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:
- SC.View dropTarget
- The proposed target of the drop.
- SC.Drag drag
- The SC.Drag instance managing this drag.
