Class Index | File Index

Classes


Class YAHOO.util.DragDropMgr


Defined in: dragdrop.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Handles the element interaction for all DragDrop items in the window.
Field Summary
Field Attributes Field Name and Description
<private> <static>  
YAHOO.util.DragDropMgr._timeoutCount
<static>  
YAHOO.util.DragDropMgr.clickPixelThresh
The number of pixels that the mouse needs to move after the mousedown before the drag is initiated.
<private> <static>  
YAHOO.util.DragDropMgr.clickTimeout
Timeout used for the click time threshold
<static>  
YAHOO.util.DragDropMgr.clickTimeThresh
The number of milliseconds after the mousedown event to initiate the drag if we don't get a mouseup event.
<private>  
css
<private> <static>  
YAHOO.util.DragDropMgr.deltaX
the X distance between the cursor and the object being dragged
<private> <static>  
YAHOO.util.DragDropMgr.deltaY
the Y distance between the cursor and the object being dragged
<private> <static>  
YAHOO.util.DragDropMgr.dragCurrent
the DragDrop object that is currently being dragged
<private> <static>  
YAHOO.util.DragDropMgr.dragOvers
the DragDrop object(s) that are being hovered over
<private> <static>  
YAHOO.util.DragDropMgr.dragThreshMet
Flag that indicates that either the drag pixel threshold or the mousdown time threshold has been met
<private>  
el
<private> <static>  
YAHOO.util.DragDropMgr.elementCache
A cache of DOM elements
<private> <static>  
YAHOO.util.DragDropMgr.handleIds
Array of element ids defined as drag handles.
<private>  
id
<private> <static>  
YAHOO.util.DragDropMgr.ids
Two dimensional Array of registered DragDrop objects.
<private> <static>  
YAHOO.util.DragDropMgr.initalized
<static>  
YAHOO.util.DragDropMgr.INTERSECT
In intersect mode, drag and drop interactio nis defined by the overlap of two or more drag and drop objects.
<private> <static>  
YAHOO.util.DragDropMgr.locationCache
Location cache that is set for all drag drop objects when a drag is initiated, cleared when the drag is finished.
<private> <static>  
YAHOO.util.DragDropMgr.locked
All drag and drop can be disabled.
<static>  
YAHOO.util.DragDropMgr.mode
The current drag and drop mode.
<static>  
YAHOO.util.DragDropMgr.POINT
In point mode, drag and drop interaction is defined by the location of the cursor during the drag/drop
<static>  
YAHOO.util.DragDropMgr.preventDefault
Flag to determine if we should prevent the default behavior of the events we define.
<private> <static>  
YAHOO.util.DragDropMgr.startX
The X position of the mousedown event stored for later use when a drag threshold is met.
<private> <static>  
YAHOO.util.DragDropMgr.startY
The Y position of the mousedown event stored for later use when a drag threshold is met.
<static>  
YAHOO.util.DragDropMgr.stopPropagation
Flag to determine if we should stop the propagation of the events we generate.
<static>  
YAHOO.util.DragDropMgr.useCache
Set useCache to false if you want to force object the lookup of each drag and drop linked element constantly during a drag.
Method Summary
Method Attributes Method Name and Description
<private> <static>  
YAHOO.util.DragDropMgr._addListeners()
Trying to make the load order less important.
<private> <static>  
YAHOO.util.DragDropMgr._execOnAll(sMethod, args)
Runs method on all drag and drop objects
<private> <static>  
YAHOO.util.DragDropMgr._onLoad()
Drag and drop initialization.
<private> <static>  
YAHOO.util.DragDropMgr._onResize(e)
Reset constraints on all drag and drop objs
<private> <static>  
YAHOO.util.DragDropMgr._onUnload(e, me)
<private> <static>  
YAHOO.util.DragDropMgr._remove(oDD)
Unregisters a drag and drop item.
<private> <static>  
YAHOO.util.DragDropMgr.ElementWrapper(el)
Inner class for cached elements
<private> <static>  
YAHOO.util.DragDropMgr.fireEvents(e, isDrop)
Iterates over all of the DragDrop elements to find ones we are hovering over or dropping on
<static>  
YAHOO.util.DragDropMgr.getBestMatch(dds)
Helper function for getting the best match from the list of drag and drop objects returned by the drag and drop events when we are in INTERSECT mode.
<static>  
YAHOO.util.DragDropMgr.getClientHeight()
Gets the client height
<static>  
YAHOO.util.DragDropMgr.getClientWidth()
Gets the client width
<static>  
YAHOO.util.DragDropMgr.getCss(id)
Returns the style property for the DOM element (i.e.
<static>  
YAHOO.util.DragDropMgr.getDDById(id)
Returns the DragDrop instance for a given id
<static>  
YAHOO.util.DragDropMgr.getElement(id)
Returns the actual DOM element
<private> <static>  
YAHOO.util.DragDropMgr.getElWrapper(id)
Get the wrapper for the DOM element specified
<static>  
YAHOO.util.DragDropMgr.getLocation(oDD)
Returns the an array containing the drag and drop element's position and size, including the DragDrop.padding configured for it
<static>  
YAHOO.util.DragDropMgr.getPosX(el)
Returns the X position of an html element
<static>  
YAHOO.util.DragDropMgr.getPosY(el)
Returns the Y position of an html element
<static>  
YAHOO.util.DragDropMgr.getRelated(p_oDD, bTargetsOnly)
Returns the drag and drop instances that are in all groups the passed in instance belongs to.
<private> <static>  
YAHOO.util.DragDropMgr.getScroll()
<static>  
YAHOO.util.DragDropMgr.getScrollLeft()
Gets the scrollLeft
<static>  
YAHOO.util.DragDropMgr.getScrollTop()
Gets the scrollTop
<static>  
YAHOO.util.DragDropMgr.getStyle(el, styleProp)
Returns the specified element style property
<private> <static>  
YAHOO.util.DragDropMgr.handleMouseDown(e, oDD)
Fired after a registered DragDrop object gets the mousedown event.
<private> <static>  
YAHOO.util.DragDropMgr.handleMouseMove(e)
Internal function to handle the mousemove event.
<private> <static>  
YAHOO.util.DragDropMgr.handleMouseUp(e)
Internal function to handle the mouseup event.
<static>  
YAHOO.util.DragDropMgr.handleWasClicked(node, id)
Recursively searches the immediate parent and all child nodes for the handle element in order to determine wheter or not it was clicked.
<private> <static>  
YAHOO.util.DragDropMgr.init()
Called the first time an element is registered.
<static>  
YAHOO.util.DragDropMgr.isDragDrop(id)
Utility function to determine if a given element has been registered as a drag drop item.
<static>  
YAHOO.util.DragDropMgr.isHandle(id, sHandleId)
Utility function to determine if a given element has been registered as a drag drop handle for the given Drag Drop object.
<static>  
YAHOO.util.DragDropMgr.isLegalTarget(the, )
Returns true if the specified dd target is a legal target for the specifice drag obj
<static>  
YAHOO.util.DragDropMgr.isLocked()
Is drag and drop locked?
<private> <static>  
YAHOO.util.DragDropMgr.isOverTarget(pt, oTarget, intersect)
Checks the cursor location to see if it over the target
<static>  
YAHOO.util.DragDropMgr.isTypeOfDD(the)
My goal is to be able to transparently determine if an object is typeof DragDrop, and the exact subclass of DragDrop.
<static>  
YAHOO.util.DragDropMgr.lock()
Lock all drag and drop functionality
<static>  
YAHOO.util.DragDropMgr.moveToEl(moveEl, targetEl)
Sets the x/y position of an element to the location of the target element.
<static>  
YAHOO.util.DragDropMgr.numericSort(a, b)
numeric array sort function
<static>  
YAHOO.util.DragDropMgr.refreshCache(groups)
Refreshes the cache of the top-left and bottom-right points of the drag and drop objects in the specified groups
<static>  
YAHOO.util.DragDropMgr.regDragDrop(oDD, sGroup)
Each DragDrop instance must be registered with the DragDropMgr.
<static>  
YAHOO.util.DragDropMgr.regHandle(sDDId, sHandleId)
Each DragDrop handle element must be registered.
<private> <static>  
YAHOO.util.DragDropMgr.removeDDFromGroup(oDD, sGroup)
Removes the supplied dd instance from the supplied group.
<static>  
YAHOO.util.DragDropMgr.startDrag(x, y)
Fired when either the drag pixel threshol or the mousedown hold time threshold has been met.
<private> <static>  
YAHOO.util.DragDropMgr.stopDrag(e)
Internal function to clean up event handlers after the drag operation is complete
<static>  
YAHOO.util.DragDropMgr.stopEvent(e)
Utility to stop event propagation and event default, if these features are turned on.
<static>  
YAHOO.util.DragDropMgr.swapNode(n1, n2)
Swap two nodes.
<static>  
YAHOO.util.DragDropMgr.unlock()
Unlock all drag and drop functionality
<private> <static>  
YAHOO.util.DragDropMgr.unregAll()
Cleans up the drag and drop events and objects.
<static>  
YAHOO.util.DragDropMgr.verifyEl(el)
This checks to make sure an element exists and is in the DOM.
Class Detail
YAHOO.util.DragDropMgr()
Handles the element interaction for all DragDrop items in the window. Generally, you will not call this class directly, but it does have helper methods that could be useful in your DragDrop implementations. This class should not be instantiated; all methods are are static.
Field Detail
<private> <static> YAHOO.util.DragDropMgr._timeoutCount

<static> {int} YAHOO.util.DragDropMgr.clickPixelThresh
The number of pixels that the mouse needs to move after the mousedown before the drag is initiated. Default=3;

<private> <static> {Object} YAHOO.util.DragDropMgr.clickTimeout
Timeout used for the click time threshold

<static> {int} YAHOO.util.DragDropMgr.clickTimeThresh
The number of milliseconds after the mousedown event to initiate the drag if we don't get a mouseup event. Default=1000

<private> css

<private> <static> {int} YAHOO.util.DragDropMgr.deltaX
the X distance between the cursor and the object being dragged

<private> <static> {int} YAHOO.util.DragDropMgr.deltaY
the Y distance between the cursor and the object being dragged

<private> <static> {DragDrop} YAHOO.util.DragDropMgr.dragCurrent
the DragDrop object that is currently being dragged

<private> <static> {Array} YAHOO.util.DragDropMgr.dragOvers
the DragDrop object(s) that are being hovered over

<private> <static> {boolean} YAHOO.util.DragDropMgr.dragThreshMet
Flag that indicates that either the drag pixel threshold or the mousdown time threshold has been met

<private> el

<private> <static> YAHOO.util.DragDropMgr.elementCache
A cache of DOM elements

<private> <static> YAHOO.util.DragDropMgr.handleIds
Array of element ids defined as drag handles. Used to determine if the element that generated the mousedown event is actually the handle and not the html element itself.

<private> id

<private> <static> YAHOO.util.DragDropMgr.ids
Two dimensional Array of registered DragDrop objects. The first dimension is the DragDrop item group, the second the DragDrop object.

<private> <static> YAHOO.util.DragDropMgr.initalized

<static> {int} YAHOO.util.DragDropMgr.INTERSECT
In intersect mode, drag and drop interactio nis defined by the overlap of two or more drag and drop objects.

<private> <static> YAHOO.util.DragDropMgr.locationCache
Location cache that is set for all drag drop objects when a drag is initiated, cleared when the drag is finished.

<private> <static> YAHOO.util.DragDropMgr.locked
All drag and drop can be disabled.

<static> {int} YAHOO.util.DragDropMgr.mode
The current drag and drop mode. Default it point mode

<static> {int} YAHOO.util.DragDropMgr.POINT
In point mode, drag and drop interaction is defined by the location of the cursor during the drag/drop

<static> {boolean} YAHOO.util.DragDropMgr.preventDefault
Flag to determine if we should prevent the default behavior of the events we define. By default this is true, but this can be set to false if you need the default behavior (not recommended)

<private> <static> {int} YAHOO.util.DragDropMgr.startX
The X position of the mousedown event stored for later use when a drag threshold is met.

<private> <static> {int} YAHOO.util.DragDropMgr.startY
The Y position of the mousedown event stored for later use when a drag threshold is met.

<static> {boolean} YAHOO.util.DragDropMgr.stopPropagation
Flag to determine if we should stop the propagation of the events we generate. This is true by default but you may want to set it to false if the html element contains other features that require the mouse click.

<static> {boolean} YAHOO.util.DragDropMgr.useCache
Set useCache to false if you want to force object the lookup of each drag and drop linked element constantly during a drag.
Method Detail
<private> <static> YAHOO.util.DragDropMgr._addListeners()
Trying to make the load order less important. Without this we get an error if this file is loaded before the Event Utility.

<private> <static> YAHOO.util.DragDropMgr._execOnAll(sMethod, args)
Runs method on all drag and drop objects
Parameters:
sMethod
args

<private> <static> YAHOO.util.DragDropMgr._onLoad()
Drag and drop initialization. Sets up the global event handlers

<private> <static> YAHOO.util.DragDropMgr._onResize(e)
Reset constraints on all drag and drop objs
Parameters:
e

<private> <static> YAHOO.util.DragDropMgr._onUnload(e, me)
Parameters:
e
me

<private> <static> YAHOO.util.DragDropMgr._remove(oDD)
Unregisters a drag and drop item. This is executed in DragDrop.unreg, use that method instead of calling this directly.
Parameters:
oDD

<private> <static> YAHOO.util.DragDropMgr.ElementWrapper(el)
Inner class for cached elements
Parameters:
el

<private> <static> YAHOO.util.DragDropMgr.fireEvents(e, isDrop)
Iterates over all of the DragDrop elements to find ones we are hovering over or dropping on
Parameters:
{Event} e
the event
{boolean} isDrop
is this a drop op or a mouseover op?

<static> {DragDrop} YAHOO.util.DragDropMgr.getBestMatch(dds)
Helper function for getting the best match from the list of drag and drop objects returned by the drag and drop events when we are in INTERSECT mode. It returns either the first object that the cursor is over, or the object that has the greatest overlap with the dragged element.
Parameters:
{DragDrop[]} dds
The array of drag and drop objects targeted
Returns:
{DragDrop} The best single match

<static> {int} YAHOO.util.DragDropMgr.getClientHeight()
Gets the client height
Returns:
{int} client height in px

<static> {int} YAHOO.util.DragDropMgr.getClientWidth()
Gets the client width
Returns:
{int} client width in px

<static> {Object} YAHOO.util.DragDropMgr.getCss(id)
Returns the style property for the DOM element (i.e., document.getElById(id).style)
Parameters:
{String} id
the id of the elment to get
Returns:
{Object} The style property of the element

<static> {DragDrop} YAHOO.util.DragDropMgr.getDDById(id)
Returns the DragDrop instance for a given id
Parameters:
{String} id
the id of the DragDrop object
Returns:
{DragDrop} the drag drop object, null if it is not found

<static> {Object} YAHOO.util.DragDropMgr.getElement(id)
Returns the actual DOM element
Parameters:
{String} id
the id of the elment to get
Returns:
{Object} The element

<private> <static> {YAHOO.util.DDM.ElementWrapper} YAHOO.util.DragDropMgr.getElWrapper(id)
Get the wrapper for the DOM element specified
Parameters:
{String} id
the id of the elment to get
Returns:
{YAHOO.util.DDM.ElementWrapper} the wrapped element

<static> YAHOO.util.DragDropMgr.getLocation(oDD)
Returns the an array containing the drag and drop element's position and size, including the DragDrop.padding configured for it
Parameters:
{DragDrop} oDD
the drag and drop object to get the location for
Returns:
array containing the top left and bottom right points of the element

<static> {int} YAHOO.util.DragDropMgr.getPosX(el)
Returns the X position of an html element
Parameters:
el
the element for which to get the position
Returns:
{int} the X coordinate

<static> {int} YAHOO.util.DragDropMgr.getPosY(el)
Returns the Y position of an html element
Parameters:
el
the element for which to get the position
Returns:
{int} the Y coordinate

<static> {DragDrop[]} YAHOO.util.DragDropMgr.getRelated(p_oDD, bTargetsOnly)
Returns the drag and drop instances that are in all groups the passed in instance belongs to.
Parameters:
{DragDrop} p_oDD
the obj to get related data for
{boolean} bTargetsOnly
if true, only return targetable objs
Returns:
{DragDrop[]} the related instances

<private> <static> YAHOO.util.DragDropMgr.getScroll()

<static> {int} YAHOO.util.DragDropMgr.getScrollLeft()
Gets the scrollLeft
Returns:
{int} the document's scrollTop

<static> {int} YAHOO.util.DragDropMgr.getScrollTop()
Gets the scrollTop
Returns:
{int} the document's scrollTop

<static> {string} YAHOO.util.DragDropMgr.getStyle(el, styleProp)
Returns the specified element style property
Parameters:
{HTMLElement} el
the element
{string} styleProp
the style property
Returns:
{string} The value of the style property

<private> <static> YAHOO.util.DragDropMgr.handleMouseDown(e, oDD)
Fired after a registered DragDrop object gets the mousedown event. Sets up the events required to track the object being dragged
Parameters:
{Event} e
the event
oDD
the DragDrop object being dragged

<private> <static> YAHOO.util.DragDropMgr.handleMouseMove(e)
Internal function to handle the mousemove event. Will be invoked from the context of the html element.
Parameters:
{Event} e
the event

<private> <static> YAHOO.util.DragDropMgr.handleMouseUp(e)
Internal function to handle the mouseup event. Will be invoked from the context of the document.
Parameters:
{Event} e
the event

<static> YAHOO.util.DragDropMgr.handleWasClicked(node, id)
Recursively searches the immediate parent and all child nodes for the handle element in order to determine wheter or not it was clicked.
Parameters:
node
the html element to inspect
id

<private> <static> YAHOO.util.DragDropMgr.init()
Called the first time an element is registered.

<static> {boolean} YAHOO.util.DragDropMgr.isDragDrop(id)
Utility function to determine if a given element has been registered as a drag drop item.
Parameters:
{String} id
the element id to check
Returns:
{boolean} true if this element is a DragDrop item, false otherwise

<static> {boolean} YAHOO.util.DragDropMgr.isHandle(id, sHandleId)
Utility function to determine if a given element has been registered as a drag drop handle for the given Drag Drop object.
Parameters:
{String} id
the element id to check
sHandleId
Returns:
{boolean} true if this element is a DragDrop handle, false otherwise

<static> {boolean} YAHOO.util.DragDropMgr.isLegalTarget(the, )
Returns true if the specified dd target is a legal target for the specifice drag obj
Parameters:
{DragDrop} the
drag obj
{DragDrop) the target
Returns:
{boolean} true if the target is a legal target for the dd obj

<static> {boolean} YAHOO.util.DragDropMgr.isLocked()
Is drag and drop locked?
Returns:
{boolean} True if drag and drop is locked, false otherwise.

<private> <static> {boolean} YAHOO.util.DragDropMgr.isOverTarget(pt, oTarget, intersect)
Checks the cursor location to see if it over the target
Parameters:
{YAHOO.util.Point} pt
The point to evaluate
{DragDrop} oTarget
the DragDrop object we are inspecting
intersect
Returns:
{boolean} true if the mouse is over the target

<static> {boolean} YAHOO.util.DragDropMgr.isTypeOfDD(the)
My goal is to be able to transparently determine if an object is typeof DragDrop, and the exact subclass of DragDrop. typeof returns "object", oDD.constructor.toString() always returns "DragDrop" and not the name of the subclass. So for now it just evaluates a well-known variable in DragDrop.
Parameters:
{Object} the
object to evaluate
Returns:
{boolean} true if typeof oDD = DragDrop

<static> YAHOO.util.DragDropMgr.lock()
Lock all drag and drop functionality

<static> YAHOO.util.DragDropMgr.moveToEl(moveEl, targetEl)
Sets the x/y position of an element to the location of the target element.
Parameters:
{HTMLElement} moveEl
The element to move
{HTMLElement} targetEl
The position reference element

<static> YAHOO.util.DragDropMgr.numericSort(a, b)
numeric array sort function
Parameters:
a
b

<static> YAHOO.util.DragDropMgr.refreshCache(groups)
Refreshes the cache of the top-left and bottom-right points of the drag and drop objects in the specified groups
Parameters:
{Object} groups
an associative array of groups to refresh

<static> YAHOO.util.DragDropMgr.regDragDrop(oDD, sGroup)
Each DragDrop instance must be registered with the DragDropMgr. This is executed in DragDrop.init()
Parameters:
{DragDrop} oDD
the DragDrop object to register
{String} sGroup
the name of the group this element belongs to

<static> YAHOO.util.DragDropMgr.regHandle(sDDId, sHandleId)
Each DragDrop handle element must be registered. This is done automatically when executing DragDrop.setHandleElId()
Parameters:
{String} sDDId
the DragDrop id this element is a handle for
{String} sHandleId
the id of the element that is the drag handle

<private> <static> YAHOO.util.DragDropMgr.removeDDFromGroup(oDD, sGroup)
Removes the supplied dd instance from the supplied group. Executed by DragDrop.removeFromGroup.
Parameters:
oDD
sGroup

<static> YAHOO.util.DragDropMgr.startDrag(x, y)
Fired when either the drag pixel threshol or the mousedown hold time threshold has been met.
Parameters:
x
{int} the X position of the original mousedown
y
{int} the Y position of the original mousedown

<private> <static> YAHOO.util.DragDropMgr.stopDrag(e)
Internal function to clean up event handlers after the drag operation is complete
Parameters:
{Event} e
the event

<static> YAHOO.util.DragDropMgr.stopEvent(e)
Utility to stop event propagation and event default, if these features are turned on.
Parameters:
{Event} e
the event as returned by this.getEvent()

<static> YAHOO.util.DragDropMgr.swapNode(n1, n2)
Swap two nodes. In IE, we use the native method, for others we emulate the IE behavior
Parameters:
n1
the first node to swap
n2
the other node to swap

<static> YAHOO.util.DragDropMgr.unlock()
Unlock all drag and drop functionality

<private> <static> YAHOO.util.DragDropMgr.unregAll()
Cleans up the drag and drop events and objects.

<static> {boolean} YAHOO.util.DragDropMgr.verifyEl(el)
This checks to make sure an element exists and is in the DOM. The main purpose is to handle cases where innerHTML is used to remove drag and drop objects from the DOM. IE provides an 'unspecified error' when trying to access the offsetParent of such an element
Parameters:
{HTMLElement} el
the element to check
Returns:
{boolean} true if the element looks usable

Documentation generated by JsDoc Toolkit 2.0.0 on Thu May 05 2011 12:20:34 GMT+0200 (CEST)