Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/docs/source/DDCore.html view on Meta::CPAN
<span id='Ext-dd-DragDropMgr-method-lock'> /**
</span> * Lock all drag and drop functionality
* @method lock
*/
lock: function() { this.locked = true; },
<span id='Ext-dd-DragDropMgr-method-unlock'> /**
</span> * Unlock all drag and drop functionality
* @method unlock
*/
unlock: function() { this.locked = false; },
<span id='Ext-dd-DragDropMgr-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-DragDropMgr-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
* @private
*/
locationCache: {},
<span id='Ext-dd-DragDropMgr-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
* @type boolean
*/
useCache: true,
<span id='Ext-dd-DragDropMgr-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
* @type int
*/
clickPixelThresh: 3,
<span id='Ext-dd-DragDropMgr-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
* @type int
*/
clickTimeThresh: 350,
<span id='Ext-dd-DragDropMgr-property-dragThreshMet'> /**
</span> * Flag that indicates that either the drag pixel threshold or the
* mousdown time threshold has been met
* @property dragThreshMet
* @type boolean
* @private
*/
dragThreshMet: false,
<span id='Ext-dd-DragDropMgr-property-clickTimeout'> /**
</span> * Timeout used for the click time threshold
* @property clickTimeout
* @type Object
* @private
*/
clickTimeout: null,
<span id='Ext-dd-DragDropMgr-property-startX'> /**
</span> * The X position of the mousedown event stored for later use when a
* drag threshold is met.
* @property startX
* @type int
* @private
*/
startX: 0,
<span id='Ext-dd-DragDropMgr-property-startY'> /**
</span> * The Y position of the mousedown event stored for later use when a
* drag threshold is met.
* @property startY
* @type int
* @private
*/
startY: 0,
<span id='Ext-dd-DragDropMgr-method-regDragDrop'> /**
</span> * Each DragDrop instance must be registered with the DragDropMgr.
* This is executed in DragDrop.init()
* @method regDragDrop
* @param {DragDrop} oDD the DragDrop object to register
* @param {String} sGroup the name of the group this element belongs to
*/
regDragDrop: function(oDD, sGroup) {
if (!this.initialized) { this.init(); }
if (!this.ids[sGroup]) {
this.ids[sGroup] = {};
}
this.ids[sGroup][oDD.id] = oDD;
},
<span id='Ext-dd-DragDropMgr-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
* @private
*/
removeDDFromGroup: function(oDD, sGroup) {
if (!this.ids[sGroup]) {
this.ids[sGroup] = {};
}
var obj = this.ids[sGroup];
if (obj && obj[oDD.id]) {
delete obj[oDD.id];
}
},
<span id='Ext-dd-DragDropMgr-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
* @private
*/
_remove: function(oDD) {
for (var g in oDD.groups) {
share/docs/source/DDCore.html view on Meta::CPAN
<span id='Ext-dd-DragDropMgr-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
* @param {String} id the element id to check
* @return {boolean} true if this element is a DragDrop handle, false
* otherwise
*/
isHandle: function(sDDId, sHandleId) {
return ( this.handleIds[sDDId] &&
this.handleIds[sDDId][sHandleId] );
},
<span id='Ext-dd-DragDropMgr-method-getDDById'> /**
</span> * Returns the DragDrop instance for a given id
* @method getDDById
* @param {String} id the id of the DragDrop object
* @return {DragDrop} the drag drop object, null if it is not found
*/
getDDById: function(id) {
for (var i in this.ids) {
if (this.ids[i][id]) {
return this.ids[i][id];
}
}
return null;
},
<span id='Ext-dd-DragDropMgr-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
* @param {Event} e the event
* @param oDD the DragDrop object being dragged
* @private
*/
handleMouseDown: function(e, oDD) {
if(Ext.QuickTips){
Ext.QuickTips.ddDisable();
}
if(this.dragCurrent){
// the original browser mouseup wasn't handled (e.g. outside FF browser window)
// so clean up first to avoid breaking the next drag
this.handleMouseUp(e);
}
this.currentTarget = e.getTarget();
this.dragCurrent = oDD;
var el = oDD.getEl();
// track start position
this.startX = e.getPageX();
this.startY = e.getPageY();
this.deltaX = this.startX - el.offsetLeft;
this.deltaY = this.startY - el.offsetTop;
this.dragThreshMet = false;
this.clickTimeout = setTimeout(
function() {
var DDM = Ext.dd.DDM;
DDM.startDrag(DDM.startX, DDM.startY);
},
this.clickTimeThresh );
},
<span id='Ext-dd-DragDropMgr-method-startDrag'> /**
</span> * Fired when either the drag pixel threshol or the mousedown hold
* time threshold has been met.
* @method startDrag
* @param x {int} the X position of the original mousedown
* @param y {int} the Y position of the original mousedown
*/
startDrag: function(x, y) {
clearTimeout(this.clickTimeout);
if (this.dragCurrent) {
this.dragCurrent.b4StartDrag(x, y);
this.dragCurrent.startDrag(x, y);
}
this.dragThreshMet = true;
},
<span id='Ext-dd-DragDropMgr-method-handleMouseUp'> /**
</span> * Internal function to handle the mouseup event. Will be invoked
* from the context of the document.
* @method handleMouseUp
* @param {Event} e the event
* @private
*/
handleMouseUp: function(e) {
if(Ext.QuickTips){
Ext.QuickTips.ddEnable();
}
if (! this.dragCurrent) {
return;
}
clearTimeout(this.clickTimeout);
if (this.dragThreshMet) {
this.fireEvents(e, true);
} else {
}
this.stopDrag(e);
this.stopEvent(e);
},
<span id='Ext-dd-DragDropMgr-method-stopEvent'> /**
</span> * Utility to stop event propagation and event default, if these
* features are turned on.
* @method stopEvent
* @param {Event} e the event as returned by this.getEvent()
*/
stopEvent: function(e){
if(this.stopPropagation) {
e.stopPropagation();
}
if (this.preventDefault) {
e.preventDefault();
}
},
<span id='Ext-dd-DragDropMgr-method-stopDrag'> /**
</span> * Internal function to clean up event handlers after the drag
* operation is complete
* @method stopDrag
* @param {Event} e the event
* @private
*/
stopDrag: function(e) {
// Fire the drag end event for the item that was dragged
if (this.dragCurrent) {
if (this.dragThreshMet) {
this.dragCurrent.b4EndDrag(e);
this.dragCurrent.endDrag(e);
}
this.dragCurrent.onMouseUp(e);
}
this.dragCurrent = null;
this.dragOvers = {};
},
<span id='Ext-dd-DragDropMgr-method-handleMouseMove'> /**
</span> * Internal function to handle the mousemove event. Will be invoked
* from the context of the html element.
*
* @TODO figure out what we can do about mouse events lost when the
* user drags objects beyond the window boundary. Currently we can
* detect this in internet explorer by verifying that the mouse is
* down during the mousemove event. Firefox doesn't give us the
* button state on the mousemove event.
* @method handleMouseMove
* @param {Event} e the event
share/docs/source/DDCore.html view on Meta::CPAN
},
<span id='Ext-dd-DragDropMgr-ElementWrapper-method-getScrollTop'> /**
</span> * Gets the scrollTop
* @method getScrollTop
* @return {int} the document's scrollTop
*/
getScrollTop: function () {
return this.getScroll().top;
},
<span id='Ext-dd-DragDropMgr-ElementWrapper-method-getScrollLeft'> /**
</span> * Gets the scrollLeft
* @method getScrollLeft
* @return {int} the document's scrollTop
*/
getScrollLeft: function () {
return this.getScroll().left;
},
<span id='Ext-dd-DragDropMgr-ElementWrapper-method-moveToEl'> /**
</span> * Sets the x/y position of an element to the location of the
* target element.
* @method moveToEl
* @param {HTMLElement} moveEl The element to move
* @param {HTMLElement} targetEl The position reference element
*/
moveToEl: function (moveEl, targetEl) {
var aCoord = Ext.lib.Dom.getXY(targetEl);
Ext.lib.Dom.setXY(moveEl, aCoord);
},
<span id='Ext-dd-DragDropMgr-ElementWrapper-method-numericSort'> /**
</span> * Numeric array sort function
* @method numericSort
*/
numericSort: function(a, b) {
return (a - b);
},
<span id='Ext-dd-DragDropMgr-ElementWrapper-property-_timeoutCount'> /**
</span> * Internal counter
* @property _timeoutCount
* @private
*/
_timeoutCount: 0,
<span id='Ext-dd-DragDropMgr-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
* @private
*/
_addListeners: function() {
var DDM = Ext.dd.DDM;
if ( Ext.lib.Event && document ) {
DDM._onLoad();
} else {
if (DDM._timeoutCount > 2000) {
} else {
setTimeout(DDM._addListeners, 10);
if (document && document.body) {
DDM._timeoutCount += 1;
}
}
}
},
<span id='Ext-dd-DragDropMgr-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.
* @method handleWasClicked
* @param node the html element to inspect
*/
handleWasClicked: function(node, id) {
if (this.isHandle(id, node.id)) {
return true;
} else {
// check to see if this is a text node child of the one we want
var p = node.parentNode;
while (p) {
if (this.isHandle(id, p.id)) {
return true;
} else {
p = p.parentNode;
}
}
}
return false;
}
};
}();
// shorter alias, save a few bytes
Ext.dd.DDM = Ext.dd.DragDropMgr;
Ext.dd.DDM._addListeners();
}
<span id='Ext-dd-DD-method-constructor'><span id='Ext-dd-DD'>/**
</span></span> * @class Ext.dd.DD
* A DragDrop implementation where the linked element follows the
* mouse cursor during a drag.
* @extends Ext.dd.DragDrop
* @constructor
* @param {String} id the id of the linked element
* @param {String} sGroup the group of related DragDrop items
* @param {object} config an object containing configurable attributes
* Valid properties for DD:
* scroll
*/
Ext.dd.DD = function(id, sGroup, config) {
if (id) {
this.init(id, sGroup, config);
}
};
share/docs/source/DDCore.html view on Meta::CPAN
* the click, the frame div is resized to the dimensions of the linked html
* element, and moved to the exact location of the linked element.
*
* References to the "frame" element refer to the single proxy element that
* was created to be dragged in place of all DDProxy elements on the
* page.
*
* @extends Ext.dd.DD
* @constructor
* @param {String} id the id of the linked html element
* @param {String} sGroup the group of related DragDrop objects
* @param {object} config an object containing configurable attributes
* Valid properties for DDProxy in addition to those in DragDrop:
* resizeFrame, centerFrame, dragElId
*/
Ext.dd.DDProxy = function(id, sGroup, config) {
if (id) {
this.init(id, sGroup, config);
this.initFrame();
}
};
<span id='Ext-dd-DDProxy-static-property-Ext.dd.DDProxy.dragElId'>/**
</span> * The default drag frame div id
* @property Ext.dd.DDProxy.dragElId
* @type String
* @static
*/
Ext.dd.DDProxy.dragElId = "ygddfdiv";
Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, {
<span id='Ext-dd-DDProxy-property-resizeFrame'> /**
</span> * By default we resize the drag frame to be the same size as the element
* we want to drag (this is to get the frame effect). We can turn it off
* if we want a different behavior.
* @property resizeFrame
* @type boolean
*/
resizeFrame: true,
<span id='Ext-dd-DDProxy-property-centerFrame'> /**
</span> * By default the frame is positioned exactly where the drag element is, so
* we use the cursor offset provided by Ext.dd.DD. Another option that works only if
* you do not have constraints on the obj is to have the drag frame centered
* around the cursor. Set centerFrame to true for this effect.
* @property centerFrame
* @type boolean
*/
centerFrame: false,
<span id='Ext-dd-DDProxy-method-createFrame'> /**
</span> * Creates the proxy element if it does not yet exist
* @method createFrame
*/
createFrame: function() {
var self = this;
var body = document.body;
if (!body || !body.firstChild) {
setTimeout( function() { self.createFrame(); }, 50 );
return;
}
var div = this.getDragEl();
if (!div) {
div = document.createElement("div");
div.id = this.dragElId;
var s = div.style;
s.position = "absolute";
s.visibility = "hidden";
s.cursor = "move";
s.border = "2px solid #aaa";
s.zIndex = 999;
// appendChild can blow up IE if invoked prior to the window load event
// while rendering a table. It is possible there are other scenarios
// that would cause this to happen as well.
body.insertBefore(div, body.firstChild);
}
},
<span id='Ext-dd-DDProxy-method-initFrame'> /**
</span> * Initialization for the drag frame element. Must be called in the
* constructor of all subclasses
* @method initFrame
*/
initFrame: function() {
this.createFrame();
},
applyConfig: function() {
Ext.dd.DDProxy.superclass.applyConfig.call(this);
this.resizeFrame = (this.config.resizeFrame !== false);
this.centerFrame = (this.config.centerFrame);
this.setDragElId(this.config.dragElId || Ext.dd.DDProxy.dragElId);
},
<span id='Ext-dd-DDProxy-method-showFrame'> /**
</span> * Resizes the drag frame to the dimensions of the clicked object, positions
* it over the object, and finally displays it
* @method showFrame
* @param {int} iPageX X click position
* @param {int} iPageY Y click position
* @private
*/
showFrame: function(iPageX, iPageY) {
var el = this.getEl();
var dragEl = this.getDragEl();
var s = dragEl.style;
this._resizeProxy();
if (this.centerFrame) {
this.setDelta( Math.round(parseInt(s.width, 10)/2),
Math.round(parseInt(s.height, 10)/2) );
}
( run in 0.502 second using v1.01-cache-2.11-cpan-ceb78f64989 )