*/
Ext.define('Ext.dd.DragDrop', {
requires: ['Ext.dd.DragDropManager'],
*/
Ext.define('Ext.dd.DragDrop', {
requires: ['Ext.dd.DragDropManager'],
/**
* Creates new DragDrop.
* @param {String} id of the element that is linked to this instance
* @param {String} sGroup the group of related DragDrop objects
/**
* Creates new DragDrop.
* @param {String} id of the element that is linked to this instance
* @param {String} sGroup the group of related DragDrop objects
/**
* Set to false to enable a DragDrop object to fire drag events while dragging
* over its own Element. Defaults to true - DragDrop objects do not by default
/**
* Set to false to enable a DragDrop object to fire drag events while dragging
* over its own Element. Defaults to true - DragDrop objects do not by default
* DragDrop object in the same group. This lets us define multiple
* groups using a single DragDrop subclass if we want.
* @property groups
* DragDrop object in the same group. This lets us define multiple
* groups using a single DragDrop subclass if we want.
* @property groups
* When set to true, other DD objects in cooperating DDGroups do not receive
* notification events when this DD object is dragged over them. Defaults to false.
* @property moveOnly
* When set to true, other DD objects in cooperating DDGroups do not receive
* notification events when this DD object is dragged over them. Defaults to false.
* @property moveOnly
* By default, all instances can be a drop target. This can be disabled by
* setting isTarget to false.
* @property isTarget
* By default, all instances can be a drop target. This can be disabled by
* setting isTarget to false.
* @property isTarget
* The padding configured for this drag and drop object for calculating
* the drop zone intersection with this object.
* An array containing the 4 padding values: [top, right, bottom, left]
* The padding configured for this drag and drop object for calculating
* the drop zone intersection with this object.
* An array containing the 4 padding values: [top, right, bottom, left]
* Array of pixel locations the element will snap to if we specified a
* horizontal graduation/interval. This array is generated automatically
* when you define a tick interval.
* Array of pixel locations the element will snap to if we specified a
* horizontal graduation/interval. This array is generated automatically
* when you define a tick interval.
* Array of pixel locations the element will snap to if we specified a
* vertical graduation/interval. This array is generated automatically
* when you define a tick interval.
* Array of pixel locations the element will snap to if we specified a
* vertical graduation/interval. This array is generated automatically
* when you define a tick interval.
/**
* Abstract method called after a drag/drop object is clicked
* and the drag or mousedown time thresholds have beeen met.
/**
* Abstract method called after a drag/drop object is clicked
* and the drag or mousedown time thresholds have beeen met.
* Abstract method called when this element fist begins hovering over
* another DragDrop obj
* @param {Event} e the mousemove event
* Abstract method called when this element fist begins hovering over
* another DragDrop obj
* @param {Event} e the mousemove event
* id this is hovering over. In INTERSECT mode, an array of one or more
* dragdrop items being hovered over.
*/
* id this is hovering over. In INTERSECT mode, an array of one or more
* dragdrop items being hovered over.
*/
* Abstract method called when this element is hovering over another
* DragDrop obj
* @param {Event} e the mousemove event
* Abstract method called when this element is hovering over another
* DragDrop obj
* @param {Event} e the mousemove event
/**
* Abstract method called when we are no longer hovering over an element
* @param {Event} e the mousemove event
/**
* Abstract method called when we are no longer hovering over an element
* @param {Event} e the mousemove event
* id this was hovering over. In INTERSECT mode, an array of dd items
* that the mouse is no longer over.
*/
* id this was hovering over. In INTERSECT mode, an array of dd items
* that the mouse is no longer over.
*/
* Abstract method called when this item is dropped on another DragDrop
* obj
* @param {Event} e the mouseup event
* Abstract method called when this item is dropped on another DragDrop
* obj
* @param {Event} e the mouseup event
- * Provides default constraint padding to "constrainTo" elements (defaults to `{left:0, right:0, top:0, bottom:0}`).
- * @type Object
+ * @property {Object} defaultPadding
+ * Provides default constraint padding to "constrainTo" elements.
*
* Ext.get("dragDiv1").initDDProxy("proxytest", {dragElId: "existingProxyDiv"}, {
* startDrag : function(){
*
* Ext.get("dragDiv1").initDDProxy("proxytest", {dragElId: "existingProxyDiv"}, {
* startDrag : function(){
* @param {Object/Number} pad (optional) Pad provides a way to specify "padding" of the constraints,
* and can be either a number for symmetrical padding (4 would be equal to `{left:4, right:4, top:4, bottom:4}`) or
* an object containing the sides to pad. For example: `{right:10, bottom:10}`
* @param {Object/Number} pad (optional) Pad provides a way to specify "padding" of the constraints,
* and can be either a number for symmetrical padding (4 would be equal to `{left:4, right:4, top:4, bottom:4}`) or
* an object containing the sides to pad. For example: `{right:10, bottom:10}`
var b = Ext.get(this.getEl()).getBox(),
ce = Ext.get(constrainTo),
s = ce.getScroll(),
var b = Ext.get(this.getEl()).getBox(),
ce = Ext.get(constrainTo),
s = ce.getScroll(),
- c = { x: s.left, y: s.top, width: Ext.core.Element.getViewWidth(), height: Ext.core.Element.getViewHeight()};
+ c = { x: s.left, y: s.top, width: Ext.Element.getViewWidth(), height: Ext.Element.getViewHeight()};
}else{
var xy = ce.getXY();
c = {x : xy[0], y: xy[1], width: cd.clientWidth, height: cd.clientHeight};
}else{
var xy = ce.getXY();
c = {x : xy[0], y: xy[1], width: cd.clientWidth, height: cd.clientHeight};
* Supports css-style shorthand; if only one parameter is passed, all sides
* will have that padding, and if only two are passed, the top and bottom
* will have the first param, the left and right the second.
* Supports css-style shorthand; if only one parameter is passed, all sides
* will have that padding, and if only two are passed, the top and bottom
* will have the first param, the left and right the second.
- * @param {int} iTop Top pad
- * @param {int} iRight Right pad
- * @param {int} iBot Bot pad
- * @param {int} iLeft Left pad
+ * @param {Number} iTop Top pad
+ * @param {Number} iRight Right pad
+ * @param {Number} iBot Bot pad
+ * @param {Number} iLeft Left pad
*/
setPadding: function(iTop, iRight, iBot, iLeft) {
// this.padding = [iLeft, iRight, iTop, iBot];
*/
setPadding: function(iTop, iRight, iBot, iLeft) {
// this.padding = [iLeft, iRight, iTop, iBot];
- * @param {int} diffX the X offset, default 0
- * @param {int} diffY the Y offset, default 0
+ * @param {Number} diffX the X offset, default 0
+ * @param {Number} diffY the Y offset, default 0
* By default, the element can be dragged any place on the screen. Use
* this method to limit the horizontal travel of the element. Pass in
* 0,0 for the parameters if you want to lock the drag to the y axis.
* By default, the element can be dragged any place on the screen. Use
* this method to limit the horizontal travel of the element. Pass in
* 0,0 for the parameters if you want to lock the drag to the y axis.
- * @param {int} iLeft the number of pixels the element can move to the left
- * @param {int} iRight the number of pixels the element can move to the
+ * @param {Number} iLeft the number of pixels the element can move to the left
+ * @param {Number} iRight the number of pixels the element can move to the
* element should move iTickSize pixels at a time.
*/
setXConstraint: function(iLeft, iRight, iTickSize) {
* element should move iTickSize pixels at a time.
*/
setXConstraint: function(iLeft, iRight, iTickSize) {
* By default, the element can be dragged any place on the screen. Set
* this to limit the vertical travel of the element. Pass in 0,0 for the
* parameters if you want to lock the drag to the x axis.
* By default, the element can be dragged any place on the screen. Set
* this to limit the vertical travel of the element. Pass in 0,0 for the
* parameters if you want to lock the drag to the x axis.
- * @param {int} iUp the number of pixels the element can move up
- * @param {int} iDown the number of pixels the element can move down
- * @param {int} iTickSize optional parameter for specifying that the
+ * @param {Number} iUp the number of pixels the element can move up
+ * @param {Number} iDown the number of pixels the element can move down
+ * @param {Number} iTickSize (optional) parameter for specifying that the
* element should move iTickSize pixels at a time.
*/
setYConstraint: function(iUp, iDown, iTickSize) {
* element should move iTickSize pixels at a time.
*/
setYConstraint: function(iUp, iDown, iTickSize) {
* Normally the drag element is moved pixel by pixel, but we can specify
* that it move a number of pixels at a time. This method resolves the
* location when we have it set up like this.
* Normally the drag element is moved pixel by pixel, but we can specify
* that it move a number of pixels at a time. This method resolves the
* location when we have it set up like this.
- * @param {int} val where we want to place the object
- * @param {int[]} tickArray sorted array of valid points
- * @return {int} the closest tick
+ * @param {Number} val where we want to place the object
+ * @param {Number[]} tickArray sorted array of valid points
+ * @return {Number} the closest tick