-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre>/*
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>The source code</title>
+ <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../prettify/prettify.js"></script>
+ <style type="text/css">
+ .highlight { display: block; background-color: #ddd; }
+ </style>
+ <script type="text/javascript">
+ function highlight() {
+ document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+ }
+ </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+ <pre class="prettyprint lang-js">/*
* This is a derivative of the similarly named class in the YUI Library.
* The original license:
* Copyright (c) 2006, Yahoo! Inc. All rights reserved.
*/
-<span id='Ext-dd.DragDropManager'>/**
+<span id='Ext-dd-DragDropManager'>/**
</span> * @class Ext.dd.DragDropManager
* DragDropManager is a singleton that tracks the element interaction for
* all DragDrop items in the window. Generally, you will not call
// shorter ClassName, to save bytes and use internally
alternateClassName: ['Ext.dd.DragDropMgr', 'Ext.dd.DDM'],
-<span id='Ext-dd.DragDropManager-property-ids'> /**
+<span id='Ext-dd-DragDropManager-property-ids'> /**
</span> * Two dimensional Array of registered DragDrop objects. The first
* dimension is the DragDrop item group, the second the DragDrop
* object.
*/
ids: {},
-<span id='Ext-dd.DragDropManager-property-handleIds'> /**
+<span id='Ext-dd-DragDropManager-property-handleIds'> /**
</span> * 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.
*/
handleIds: {},
-<span id='Ext-dd.DragDropManager-property-dragCurrent'> /**
+<span id='Ext-dd-DragDropManager-property-dragCurrent'> /**
</span> * the DragDrop object that is currently being dragged
* @property dragCurrent
* @type DragDrop
**/
dragCurrent: null,
-<span id='Ext-dd.DragDropManager-property-dragOvers'> /**
+<span id='Ext-dd-DragDropManager-property-dragOvers'> /**
</span> * the DragDrop object(s) that are being hovered over
* @property dragOvers
* @type Array
*/
dragOvers: {},
-<span id='Ext-dd.DragDropManager-property-deltaX'> /**
+<span id='Ext-dd-DragDropManager-property-deltaX'> /**
</span> * the X distance between the cursor and the object being dragged
* @property deltaX
* @type int
*/
deltaX: 0,
-<span id='Ext-dd.DragDropManager-property-deltaY'> /**
+<span id='Ext-dd-DragDropManager-property-deltaY'> /**
</span> * the Y distance between the cursor and the object being dragged
* @property deltaY
* @type int
*/
deltaY: 0,
-<span id='Ext-dd.DragDropManager-property-preventDefault'> /**
+<span id='Ext-dd-DragDropManager-property-preventDefault'> /**
</span> * 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)
*/
preventDefault: true,
-<span id='Ext-dd.DragDropManager-property-stopPropagation'> /**
+<span id='Ext-dd-DragDropManager-property-stopPropagation'> /**
</span> * 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
*/
stopPropagation: true,
-<span id='Ext-dd.DragDropManager-property-initialized'> /**
+<span id='Ext-dd-DragDropManager-property-initialized'> /**
</span> * Internal flag that is set to true when drag and drop has been
* intialized
* @property initialized
*/
initialized: false,
-<span id='Ext-dd.DragDropManager-property-locked'> /**
+<span id='Ext-dd-DragDropManager-property-locked'> /**
</span> * All drag and drop can be disabled.
* @property locked
* @private
*/
locked: false,
-<span id='Ext-dd.DragDropManager-method-init'> /**
+<span id='Ext-dd-DragDropManager-method-init'> /**
</span> * Called the first time an element is registered.
* @method init
* @private
this.initialized = true;
},
-<span id='Ext-dd.DragDropManager-property-POINT'> /**
+<span id='Ext-dd-DragDropManager-property-POINT'> /**
</span> * In point mode, drag and drop interaction is defined by the
* location of the cursor during the drag/drop
* @property POINT
*/
POINT: 0,
-<span id='Ext-dd.DragDropManager-property-INTERSECT'> /**
+<span id='Ext-dd-DragDropManager-property-INTERSECT'> /**
</span> * In intersect mode, drag and drop interaction is defined by the
* overlap of two or more drag and drop objects.
* @property INTERSECT
*/
INTERSECT: 1,
-<span id='Ext-dd.DragDropManager-property-mode'> /**
+<span id='Ext-dd-DragDropManager-property-mode'> /**
</span> * The current drag and drop mode. Default: POINT
* @property mode
* @type int
*/
mode: 0,
-<span id='Ext-dd.DragDropManager-method-_execOnAll'> /**
+<span id='Ext-dd-DragDropManager-method-_execOnAll'> /**
</span> * Runs method on all drag and drop objects
* @method _execOnAll
* @private
}
},
-<span id='Ext-dd.DragDropManager-method-_onLoad'> /**
+<span id='Ext-dd-DragDropManager-method-_onLoad'> /**
</span> * Drag and drop initialization. Sets up the global event handlers
* @method _onLoad
* @private
},
-<span id='Ext-dd.DragDropManager-method-_onResize'> /**
+<span id='Ext-dd-DragDropManager-method-_onResize'> /**
</span> * Reset constraints on all drag and drop objs
* @method _onResize
* @private
this._execOnAll("resetConstraints", []);
},
-<span id='Ext-dd.DragDropManager-method-lock'> /**
+<span id='Ext-dd-DragDropManager-method-lock'> /**
</span> * Lock all drag and drop functionality
* @method lock
* @static
*/
lock: function() { this.locked = true; },
-<span id='Ext-dd.DragDropManager-method-unlock'> /**
+<span id='Ext-dd-DragDropManager-method-unlock'> /**
</span> * Unlock all drag and drop functionality
* @method unlock
* @static
*/
unlock: function() { this.locked = false; },
-<span id='Ext-dd.DragDropManager-method-isLocked'> /**
+<span id='Ext-dd-DragDropManager-method-isLocked'> /**
</span> * Is drag and drop locked?
* @method isLocked
* @return {boolean} True if drag and drop is locked, false otherwise.
*/
isLocked: function() { return this.locked; },
-<span id='Ext-dd.DragDropManager-property-locationCache'> /**
+<span id='Ext-dd-DragDropManager-property-locationCache'> /**
</span> * Location cache that is set for all drag drop objects when a drag is
* initiated, cleared when the drag is finished.
* @property locationCache
*/
locationCache: {},
-<span id='Ext-dd.DragDropManager-property-useCache'> /**
+<span id='Ext-dd-DragDropManager-property-useCache'> /**
</span> * Set useCache to false if you want to force object the lookup of each
* drag and drop linked element constantly during a drag.
* @property useCache
*/
useCache: true,
-<span id='Ext-dd.DragDropManager-property-clickPixelThresh'> /**
+<span id='Ext-dd-DragDropManager-property-clickPixelThresh'> /**
</span> * The number of pixels that the mouse needs to move after the
* mousedown before the drag is initiated. Default=3;
* @property clickPixelThresh
*/
clickPixelThresh: 3,
-<span id='Ext-dd.DragDropManager-property-clickTimeThresh'> /**
+<span id='Ext-dd-DragDropManager-property-clickTimeThresh'> /**
</span> * The number of milliseconds after the mousedown event to initiate the
* drag if we don't get a mouseup event. Default=350
* @property clickTimeThresh
*/
clickTimeThresh: 350,
-<span id='Ext-dd.DragDropManager-property-dragThreshMet'> /**
+<span id='Ext-dd-DragDropManager-property-dragThreshMet'> /**
</span> * Flag that indicates that either the drag pixel threshold or the
* mousdown time threshold has been met
* @property dragThreshMet
*/
dragThreshMet: false,
-<span id='Ext-dd.DragDropManager-property-clickTimeout'> /**
+<span id='Ext-dd-DragDropManager-property-clickTimeout'> /**
</span> * Timeout used for the click time threshold
* @property clickTimeout
* @type Object
*/
clickTimeout: null,
-<span id='Ext-dd.DragDropManager-property-startX'> /**
+<span id='Ext-dd-DragDropManager-property-startX'> /**
</span> * The X position of the mousedown event stored for later use when a
* drag threshold is met.
* @property startX
*/
startX: 0,
-<span id='Ext-dd.DragDropManager-property-startY'> /**
+<span id='Ext-dd-DragDropManager-property-startY'> /**
</span> * The Y position of the mousedown event stored for later use when a
* drag threshold is met.
* @property startY
*/
startY: 0,
-<span id='Ext-dd.DragDropManager-method-regDragDrop'> /**
+<span id='Ext-dd-DragDropManager-method-regDragDrop'> /**
</span> * Each DragDrop instance must be registered with the DragDropManager.
* This is executed in DragDrop.init()
* @method regDragDrop
this.ids[sGroup][oDD.id] = oDD;
},
-<span id='Ext-dd.DragDropManager-method-removeDDFromGroup'> /**
+<span id='Ext-dd-DragDropManager-method-removeDDFromGroup'> /**
</span> * Removes the supplied dd instance from the supplied group. Executed
* by DragDrop.removeFromGroup, so don't call this function directly.
* @method removeDDFromGroup
}
},
-<span id='Ext-dd.DragDropManager-method-_remove'> /**
+<span id='Ext-dd-DragDropManager-method-_remove'> /**
</span> * Unregisters a drag and drop item. This is executed in
* DragDrop.unreg, use that method instead of calling this directly.
* @method _remove
delete this.handleIds[oDD.id];
},
-<span id='Ext-dd.DragDropManager-method-regHandle'> /**
+<span id='Ext-dd-DragDropManager-method-regHandle'> /**
</span> * Each DragDrop handle element must be registered. This is done
* automatically when executing DragDrop.setHandleElId()
* @method regHandle
this.handleIds[sDDId][sHandleId] = sHandleId;
},
-<span id='Ext-dd.DragDropManager-method-isDragDrop'> /**
+<span id='Ext-dd-DragDropManager-method-isDragDrop'> /**
</span> * Utility function to determine if a given element has been
* registered as a drag drop item.
* @method isDragDrop
return ( this.getDDById(id) ) ? true : false;
},
-<span id='Ext-dd.DragDropManager-method-getRelated'> /**
+<span id='Ext-dd-DragDropManager-method-getRelated'> /**
</span> * Returns the drag and drop instances that are in all groups the
* passed in instance belongs to.
* @method getRelated
return oDDs;
},
-<span id='Ext-dd.DragDropManager-method-isLegalTarget'> /**
+<span id='Ext-dd-DragDropManager-method-isLegalTarget'> /**
</span> * Returns true if the specified dd target is a legal target for
* the specifice drag obj
* @method isLegalTarget
return false;
},
-<span id='Ext-dd.DragDropManager-method-isTypeOfDD'> /**
+<span id='Ext-dd-DragDropManager-method-isTypeOfDD'> /**
</span> * 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
return (oDD && oDD.__ygDragDrop);
},
-<span id='Ext-dd.DragDropManager-method-isHandle'> /**
+<span id='Ext-dd-DragDropManager-method-isHandle'> /**
</span> * Utility function to determine if a given element has been
* registered as a drag drop handle for the given Drag Drop object.
* @method isHandle
this.handleIds[sDDId][sHandleId] );
},
-<span id='Ext-dd.DragDropManager-method-getDDById'> /**
+<span id='Ext-dd-DragDropManager-method-getDDById'> /**
</span> * Returns the DragDrop instance for a given id
* @method getDDById
* @param {String} id the id of the DragDrop object
return null;
},
-<span id='Ext-dd.DragDropManager-method-handleMouseDown'> /**
+<span id='Ext-dd-DragDropManager-method-handleMouseDown'> /**
</span> * Fired after a registered DragDrop object gets the mousedown event.
* Sets up the events required to track the object being dragged
* @method handleMouseDown
this.clickTimeThresh );
},
-<span id='Ext-dd.DragDropManager-method-startDrag'> /**
+<span id='Ext-dd-DragDropManager-method-startDrag'> /**
</span> * Fired when either the drag pixel threshol or the mousedown hold
* time threshold has been met.
* @method startDrag
this.dragThreshMet = true;
},
-<span id='Ext-dd.DragDropManager-method-handleMouseUp'> /**
+<span id='Ext-dd-DragDropManager-method-handleMouseUp'> /**
</span> * Internal function to handle the mouseup event. Will be invoked
* from the context of the document.
* @method handleMouseUp
this.stopEvent(e);
},
-<span id='Ext-dd.DragDropManager-method-stopEvent'> /**
+<span id='Ext-dd-DragDropManager-method-stopEvent'> /**
</span> * Utility to stop event propagation and event default, if these
* features are turned on.
* @method stopEvent
}
},
-<span id='Ext-dd.DragDropManager-method-stopDrag'> /**
+<span id='Ext-dd-DragDropManager-method-stopDrag'> /**
</span> * Internal function to clean up event handlers after the drag
* operation is complete
* @method stopDrag
this.dragOvers = {};
},
-<span id='Ext-dd.DragDropManager-method-handleMouseMove'> /**
+<span id='Ext-dd-DragDropManager-method-handleMouseMove'> /**
</span> * Internal function to handle the mousemove event. Will be invoked
* from the context of the html element.
*
return true;
},
-<span id='Ext-dd.DragDropManager-method-fireEvents'> /**
+<span id='Ext-dd-DragDropManager-method-fireEvents'> /**
</span> * Iterates over all of the DragDrop elements to find ones we are
* hovering over or dropping on
* @method fireEvents
},
-<span id='Ext-dd.DragDropManager-method-getBestMatch'> /**
+<span id='Ext-dd-DragDropManager-method-getBestMatch'> /**
</span> * 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
return winner;
},
-<span id='Ext-dd.DragDropManager-method-refreshCache'> /**
+<span id='Ext-dd-DragDropManager-method-refreshCache'> /**
</span> * Refreshes the cache of the top-left and bottom-right points of the
* drag and drop objects in the specified group(s). This is in the
* format that is stored in the drag and drop instance, so typical
}
},
-<span id='Ext-dd.DragDropManager-method-verifyEl'> /**
+<span id='Ext-dd-DragDropManager-method-verifyEl'> /**
</span> * 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
return false;
},
-<span id='Ext-dd.DragDropManager-method-getLocation'> /**
+<span id='Ext-dd-DragDropManager-method-getLocation'> /**
</span> * Returns a Region object containing the drag and drop element's position
* and size, including the padding configured for it
* @method getLocation
return Ext.create('Ext.util.Region', t, r, b, l);
},
-<span id='Ext-dd.DragDropManager-method-isOverTarget'> /**
+<span id='Ext-dd-DragDropManager-method-isOverTarget'> /**
</span> * Checks the cursor location to see if it over the target
* @method isOverTarget
* @param {Ext.util.Point} pt The point to evaluate
}
},
-<span id='Ext-dd.DragDropManager-method-_onUnload'> /**
+<span id='Ext-dd-DragDropManager-method-_onUnload'> /**
</span> * unload event handler
* @method _onUnload
* @private
Ext.dd.DragDropManager.unregAll();
},
-<span id='Ext-dd.DragDropManager-method-unregAll'> /**
+<span id='Ext-dd-DragDropManager-method-unregAll'> /**
</span> * Cleans up the drag and drop events and objects.
* @method unregAll
* @private
this.ids = {};
},
-<span id='Ext-dd.DragDropManager-property-elementCache'> /**
+<span id='Ext-dd-DragDropManager-property-elementCache'> /**
</span> * A cache of DOM elements
* @property elementCache
* @private
*/
elementCache: {},
-<span id='Ext-dd.DragDropManager-method-getElWrapper'> /**
+<span id='Ext-dd-DragDropManager-method-getElWrapper'> /**
</span> * Get the wrapper for the DOM element specified
* @method getElWrapper
* @param {String} id the id of the element to get
return oWrapper;
},
-<span id='Ext-dd.DragDropManager-method-getElement'> /**
+<span id='Ext-dd-DragDropManager-method-getElement'> /**
</span> * Returns the actual DOM element
* @method getElement
* @param {String} id the id of the elment to get
return Ext.getDom(id);
},
-<span id='Ext-dd.DragDropManager-method-getCss'> /**
+<span id='Ext-dd-DragDropManager-method-getCss'> /**
</span> * Returns the style property for the DOM element (i.e.,
* document.getElById(id).style)
* @method getCss
return (el) ? el.style : null;
},
-<span id='Ext-dd.DragDropManager.ElementWrapper'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper'> /**
</span> * Inner class for cached elements
* @class Ext.dd.DragDropManager.ElementWrapper
* @for DragDropManager
* @deprecated
*/
ElementWrapper: function(el) {
-<span id='Ext-dd.DragDropManager.ElementWrapper-property-el'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-property-el'> /**
</span> * The element
* @property el
*/
this.el = el || null;
-<span id='Ext-dd.DragDropManager.ElementWrapper-property-id'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-property-id'> /**
</span> * The element id
* @property id
*/
this.id = this.el && el.id;
-<span id='Ext-dd.DragDropManager.ElementWrapper-property-css'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-property-css'> /**
</span> * A reference to the style property
* @property css
*/
this.css = this.el && el.style;
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-getPosX'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-getPosX'> /**
</span> * Returns the X position of an html element
* @method getPosX
* @param el the element for which to get the position
return Ext.core.Element.getX(el);
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-getPosY'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-getPosY'> /**
</span> * Returns the Y position of an html element
* @method getPosY
* @param el the element for which to get the position
return Ext.core.Element.getY(el);
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-swapNode'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-swapNode'> /**
</span> * Swap two nodes. In IE, we use the native method, for others we
* emulate the IE behavior
* @method swapNode
}
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-getScroll'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-getScroll'> /**
</span> * Returns the current scroll position
* @method getScroll
* @private
};
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-getStyle'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-getStyle'> /**
</span> * Returns the specified element style property
* @method getStyle
* @param {HTMLElement} el the element
return Ext.fly(el).getStyle(styleProp);
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-getScrollTop'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-getScrollTop'> /**
</span> * Gets the scrollTop
* @method getScrollTop
* @return {int} the document's scrollTop
return this.getScroll().top;
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-getScrollLeft'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-getScrollLeft'> /**
</span> * Gets the scrollLeft
* @method getScrollLeft
* @return {int} the document's scrollTop
return this.getScroll().left;
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-moveToEl'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-moveToEl'> /**
</span> * Sets the x/y position of an element to the location of the
* target element.
* @method moveToEl
Ext.core.Element.setXY(moveEl, aCoord);
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-numericSort'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-numericSort'> /**
</span> * Numeric array sort function
* @method numericSort
* @static
return (a - b);
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-property-_timeoutCount'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-property-_timeoutCount'> /**
</span> * Internal counter
* @property _timeoutCount
* @private
*/
_timeoutCount: 0,
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-_addListeners'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-_addListeners'> /**
</span> * Trying to make the load order less important. Without this we get
* an error if this file is loaded before the Event Utility.
* @method _addListeners
}
},
-<span id='Ext-dd.DragDropManager.ElementWrapper-method-handleWasClicked'> /**
+<span id='Ext-dd-DragDropManager-ElementWrapper-method-handleWasClicked'> /**
</span> * Recursively searches the immediate parent and all child nodes for
* the handle element in order to determine wheter or not it was
* clicked.
}, function() {
this._addListeners();
});
-</pre></pre></body></html>
\ No newline at end of file
+</pre>
+</body>
+</html>