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-DragDrop-property-invalidHandleTypes'>    /**
</span>     * An object who's property names identify HTML tags to be considered invalid as drag handles.
     * A non-null property value identifies the tag as invalid. Defaults to the 
     * following value which prevents drag operations from being initiated by &amp;lt;a&gt; elements:&lt;pre&gt;&lt;code&gt;
{
    A: &quot;A&quot;
}&lt;/code&gt;&lt;/pre&gt;
     * @property invalidHandleTypes
     * @type Object
     */
    invalidHandleTypes: null,

<span id='Ext-dd-DragDrop-property-invalidHandleIds'>    /**
</span>     * An object who's property names identify the IDs of elements to be considered invalid as drag handles.
     * A non-null property value identifies the ID as invalid. For example, to prevent
     * dragging from being initiated on element ID &quot;foo&quot;, use:&lt;pre&gt;&lt;code&gt;
{
    foo: true
}&lt;/code&gt;&lt;/pre&gt;
     * @property invalidHandleIds
     * @type Object
     */
    invalidHandleIds: null,

<span id='Ext-dd-DragDrop-property-invalidHandleClasses'>    /**
</span>     * An Array of CSS class names for elements to be considered in valid as drag handles.
     * @property invalidHandleClasses
     * @type Array
     */
    invalidHandleClasses: null,

<span id='Ext-dd-DragDrop-property-startPageX'>    /**
</span>     * The linked element's absolute X position at the time the drag was
     * started
     * @property startPageX
     * @type int
     * @private
     */
    startPageX: 0,

<span id='Ext-dd-DragDrop-property-startPageY'>    /**
</span>     * The linked element's absolute X position at the time the drag was
     * started
     * @property startPageY
     * @type int
     * @private
     */
    startPageY: 0,

<span id='Ext-dd-DragDrop-property-groups'>    /**
</span>     * The group defines a logical collection of DragDrop objects that are
     * related.  Instances only get events when interacting with other
     * DragDrop object in the same group.  This lets us define multiple
     * groups using a single DragDrop subclass if we want.
     * @property groups
     * @type object An object in the format {'group1':true, 'group2':true}
     */
    groups: null,

<span id='Ext-dd-DragDrop-property-locked'>    /**
</span>     * Individual drag/drop instances can be locked.  This will prevent
     * onmousedown start drag.
     * @property locked
     * @type boolean
     * @private
     */
    locked: false,

<span id='Ext-dd-DragDrop-method-lock'>    /**
</span>     * Lock this instance
     * @method lock
     */
    lock: function() {
        this.locked = true;
    },

<span id='Ext-dd-DragDrop-property-moveOnly'>    /**
</span>     * 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
     * @type boolean
     */
    moveOnly: false,

<span id='Ext-dd-DragDrop-method-unlock'>    /**
</span>     * Unlock this instace
     * @method unlock
     */
    unlock: function() {
        this.locked = false;
    },

<span id='Ext-dd-DragDrop-property-isTarget'>    /**
</span>     * By default, all instances can be a drop target.  This can be disabled by
     * setting isTarget to false.
     * @property isTarget
     * @type boolean
     */
    isTarget: true,

<span id='Ext-dd-DragDrop-property-padding'>    /**
</span>     * The padding configured for this drag and drop object for calculating
     * the drop zone intersection with this object.
     * @property padding
     * @type int[] An array containing the 4 padding values: [top, right, bottom, left]
     */
    padding: null,

<span id='Ext-dd-DragDrop-property-_domRef'>    /**
</span>     * Cached reference to the linked element
     * @property _domRef
     * @private
     */
    _domRef: null,

<span id='Ext-dd-DragDrop-property-__ygDragDrop'>    /**
</span>     * Internal typeof flag
     * @property __ygDragDrop
     * @private
     */
    __ygDragDrop: true,

<span id='Ext-dd-DragDrop-property-constrainX'>    /**
</span>     * Set to true when horizontal contraints are applied
     * @property constrainX
     * @type boolean
     * @private
     */
    constrainX: false,

<span id='Ext-dd-DragDrop-property-constrainY'>    /**
</span>     * Set to true when vertical contraints are applied
     * @property constrainY
     * @type boolean
     * @private
     */
    constrainY: false,

<span id='Ext-dd-DragDrop-property-minX'>    /**
</span>     * The left constraint
     * @property minX
     * @type int
     * @private
     */
    minX: 0,

<span id='Ext-dd-DragDrop-property-maxX'>    /**
</span>     * The right constraint
     * @property maxX
     * @type int

share/docs/source/DDCore.html  view on Meta::CPAN

     * will be moved with the cursor during a drag
     * @method setDragElId
     * @param id {string} the id of the element that will be used to initiate the drag
     */
    setDragElId: function(id) {
        this.dragElId = id;
    },

<span id='Ext-dd-DragDrop-method-setHandleElId'>    /**
</span>     * Allows you to specify a child of the linked element that should be
     * used to initiate the drag operation.  An example of this would be if
     * you have a content div with text and links.  Clicking anywhere in the
     * content area would normally start the drag operation.  Use this method
     * to specify that an element inside of the content div is the element
     * that starts the drag operation.
     * @method setHandleElId
     * @param id {string} the id of the element that will be used to
     * initiate the drag.
     */
    setHandleElId: function(id) {
        if (typeof id !== &quot;string&quot;) {
            id = Ext.id(id);
        }
        this.handleElId = id;
        this.DDM.regHandle(this.id, id);
    },

<span id='Ext-dd-DragDrop-method-setOuterHandleElId'>    /**
</span>     * Allows you to set an element outside of the linked element as a drag
     * handle
     * @method setOuterHandleElId
     * @param id the id of the element that will be used to initiate the drag
     */
    setOuterHandleElId: function(id) {
        if (typeof id !== &quot;string&quot;) {
            id = Ext.id(id);
        }
        Event.on(id, &quot;mousedown&quot;,
                this.handleMouseDown, this);
        this.setHandleElId(id);

        this.hasOuterHandles = true;
    },

<span id='Ext-dd-DragDrop-method-unreg'>    /**
</span>     * Remove all drag and drop hooks for this element
     * @method unreg
     */
    unreg: function() {
        Event.un(this.id, &quot;mousedown&quot;,
                this.handleMouseDown);
        this._domRef = null;
        this.DDM._remove(this);
    },

    destroy : function(){
        this.unreg();
    },

<span id='Ext-dd-DragDrop-method-isLocked'>    /**
</span>     * Returns true if this instance is locked, or the drag drop mgr is locked
     * (meaning that all drag/drop is disabled on the page.)
     * @method isLocked
     * @return {boolean} true if this obj or all drag/drop is locked, else
     * false
     */
    isLocked: function() {
        return (this.DDM.isLocked() || this.locked);
    },

<span id='Ext-dd-DragDrop-method-handleMouseDown'>    /**
</span>     * Fired when this object is clicked
     * @method handleMouseDown
     * @param {Event} e
     * @param {Ext.dd.DragDrop} oDD the clicked dd object (this dd obj)
     * @private
     */
    handleMouseDown: function(e, oDD){
        if (this.primaryButtonOnly &amp;&amp; e.button != 0) {
            return;
        }

        if (this.isLocked()) {
            return;
        }

        this.DDM.refreshCache(this.groups);

        var pt = new Ext.lib.Point(Ext.lib.Event.getPageX(e), Ext.lib.Event.getPageY(e));
        if (!this.hasOuterHandles &amp;&amp; !this.DDM.isOverTarget(pt, this) )  {
        } else {
            if (this.clickValidator(e)) {

                // set the initial element position
                this.setStartPosition();

                this.b4MouseDown(e);
                this.onMouseDown(e);

                this.DDM.handleMouseDown(e, this);

                if (this.preventDefault || this.stopPropagation) {
                    if (this.preventDefault) {
                        e.preventDefault();
                    }
                    if (this.stopPropagation) {
                        e.stopPropagation();
                    }
                } else {
                    this.DDM.stopEvent(e);
                }
            } else {


            }
        }
    },

    clickValidator: function(e) {
        var target = e.getTarget();
        return ( this.isValidHandleChild(target) &amp;&amp;
                    (this.id == this.handleElId ||
                        this.DDM.handleWasClicked(target, this.id)) );
    },

<span id='Ext-dd-DragDrop-method-addInvalidHandleType'>    /**
</span>     * Allows you to specify a tag name that should not start a drag operation
     * when clicked.  This is designed to facilitate embedding links within a

share/docs/source/DDCore.html  view on Meta::CPAN


<span id='Ext-dd-DragDropMgr-property-dragCurrent'>        /**
</span>         * the DragDrop object that is currently being dragged
         * @property dragCurrent
         * @type DragDrop
         * @private
         **/
        dragCurrent: null,

<span id='Ext-dd-DragDropMgr-property-dragOvers'>        /**
</span>         * the DragDrop object(s) that are being hovered over
         * @property dragOvers
         * @type Array
         * @private
         */
        dragOvers: {},

<span id='Ext-dd-DragDropMgr-property-deltaX'>        /**
</span>         * the X distance between the cursor and the object being dragged
         * @property deltaX
         * @type int
         * @private
         */
        deltaX: 0,

<span id='Ext-dd-DragDropMgr-property-deltaY'>        /**
</span>         * the Y distance between the cursor and the object being dragged
         * @property deltaY
         * @type int
         * @private
         */
        deltaY: 0,

<span id='Ext-dd-DragDropMgr-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)
         * @property preventDefault
         * @type boolean
         */
        preventDefault: true,

<span id='Ext-dd-DragDropMgr-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
         * mouse click.
         * @property stopPropagation
         * @type boolean
         */
        stopPropagation: true,

<span id='Ext-dd-DragDropMgr-property-initialized'>        /**
</span>         * Internal flag that is set to true when drag and drop has been
         * intialized
         * @property initialized
         * @private
         */
        initialized: false,

<span id='Ext-dd-DragDropMgr-property-locked'>        /**
</span>         * All drag and drop can be disabled.
         * @property locked
         * @private
         */
        locked: false,

<span id='Ext-dd-DragDropMgr-method-init'>        /**
</span>         * Called the first time an element is registered.
         * @method init
         * @private
         */
        init: function() {
            this.initialized = true;
        },

<span id='Ext-dd-DragDropMgr-property-POINT'>        /**
</span>         * In point mode, drag and drop interaction is defined by the
         * location of the cursor during the drag/drop
         * @property POINT
         * @type int
         */
        POINT: 0,

<span id='Ext-dd-DragDropMgr-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
         * @type int
         */
        INTERSECT: 1,

<span id='Ext-dd-DragDropMgr-property-mode'>        /**
</span>         * The current drag and drop mode.  Default: POINT
         * @property mode
         * @type int
         */
        mode: 0,
        
<span id='Ext-dd-DragDropMgr-property-notifyOccluded'>        /**
</span>         * @property {Boolean} [notifyOccluded=false]
         * This config is only provided to provide old, usually unwanted drag/drop behaviour.
         *
         * From ExtJS 4.1.0 onwards, when drop targets are contained in floating, absolutely positioned elements
         * such as in {@link Ext.window.Window Windows}, which may overlap each other, `over` and `drop` events
         * are only delivered to the topmost drop target at the mouse position.
         *
         * If all targets below that in zIndex order should also receive notifications, set
         * `notifyOccluded` to `true`.
         */
        notifyOccluded: false,

<span id='Ext-dd-DragDropMgr-method-_execOnAll'>        /**
</span>         * Runs method on all drag and drop objects
         * @method _execOnAll
         * @private
         */
        _execOnAll: function(sMethod, args) {
            for (var i in this.ids) {
                for (var j in this.ids[i]) {
                    var oDD = this.ids[i][j];
                    if (! this.isTypeOfDD(oDD)) {
                        continue;
                    }
                    oDD[sMethod].apply(oDD, args);
                }
            }
        },

<span id='Ext-dd-DragDropMgr-method-_onLoad'>        /**
</span>         * Drag and drop initialization.  Sets up the global event handlers
         * @method _onLoad
         * @private
         */
        _onLoad: function() {

            this.init();


            Event.on(document, &quot;mouseup&quot;,   this.handleMouseUp, this, true);
            Event.on(document, &quot;mousemove&quot;, this.handleMouseMove, this, true);
            Event.on(window,   &quot;unload&quot;,    this._onUnload, this, true);
            Event.on(window,   &quot;resize&quot;,    this._onResize, this, true);
            // Event.on(window,   &quot;mouseout&quot;,    this._test);

        },

<span id='Ext-dd-DragDropMgr-method-_onResize'>        /**
</span>         * Reset constraints on all drag and drop objs
         * @method _onResize
         * @private
         */
        _onResize: function(e) {
            this._execOnAll(&quot;resetConstraints&quot;, []);
        },

<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'>        /**

share/docs/source/DDCore.html  view on Meta::CPAN

         * @param {Event} e the event
         * @param {boolean} isDrop is this a drop op or a mouseover op?
         * @private
         */
        fireEvents: function(e, isDrop) {
            var me = this,
                dragCurrent = me.dragCurrent,
                mousePoint = e.getPoint(),
                overTarget,
                overTargetEl,
                allTargets = [],
                oldOvers  = [],  // cache the previous dragOver array
                outEvts   = [],
                overEvts  = [],
                dropEvts  = [],
                enterEvts = [],
                needsSort,
                i,
                len,
                sGroup;

            // If the user did the mouse up outside of the window, we could
            // get here even though we have ended the drag.
            if (!dragCurrent || dragCurrent.isLocked()) {
                return;
            }

            // Check to see if the object(s) we were hovering over is no longer
            // being hovered over so we can fire the onDragOut event
            for (i in me.dragOvers) {
                overTarget = me.dragOvers[i];

                if (! me.isTypeOfDD(overTarget)) {
                    continue;
                }

                if (! this.isOverTarget(mousePoint, overTarget, me.mode)) {
                    outEvts.push( overTarget );
                }

                oldOvers[i] = true;
                delete me.dragOvers[i];
            }

            // Collect all targets which are members of the same ddGoups that the dragCurrent is a member of, and which may recieve mouseover and drop notifications.
            // This is preparatory to seeing which one(s) we are currently over
            // Begin by iterating through the ddGroups of which the dragCurrent is a member
            for (sGroup in dragCurrent.groups) {

                if (&quot;string&quot; != typeof sGroup) {
                    continue;
                }

                // Loop over the registered members of each group, testing each as a potential target
                for (i in me.ids[sGroup]) {
                    overTarget = me.ids[sGroup][i];

                    // The target is valid if it is a DD type
                    // And it's got a DOM element
                    // And it's configured to be a drop target
                    // And it's not locked
                    // And it's either not the dragCurrent, or, if it is, tha dragCurrent is configured to not ignore itself.
                    if (me.isTypeOfDD(overTarget) &amp;&amp;
                        (overTargetEl = overTarget.getEl()) &amp;&amp;
                        (overTarget.isTarget) &amp;&amp;
                        (!overTarget.isLocked()) &amp;&amp;
                        ((overTarget != dragCurrent) || (dragCurrent.ignoreSelf === false))) {

                        // Only sort by zIndex if there were some which had a floating zIndex value
                        if ((overTarget.zIndex = me.getZIndex(overTargetEl)) !== -1) {
                            needsSort = true;
                        }
                        allTargets.push(overTarget);
                    }
                }
            }

            // If there were floating targets, sort the highest zIndex to the top
            if (needsSort) {
                allTargets.sort(me.byZIndex);
            }

            // Loop through possible targets, notifying the one(s) we are over.
            // Usually we only deliver events to the topmost.
            for (i = 0, len = allTargets.length; i &lt; len; i++) {
                overTarget = allTargets[i];

                // If we are over the overTarget, queue it up to recieve an event of whatever type we are handling
                if (me.isOverTarget(mousePoint, overTarget, me.mode)) {
                    // look for drop interactions
                    if (isDrop) {
                        dropEvts.push( overTarget );
                    // look for drag enter and drag over interactions
                    } else {
                        // initial drag over: dragEnter fires
                        if (!oldOvers[overTarget.id]) {
                            enterEvts.push( overTarget );
                        // subsequent drag overs: dragOver fires
                        } else {
                            overEvts.push( overTarget );
                        }
                        me.dragOvers[overTarget.id] = overTarget;
                    }

                    // Unless this DragDropManager has been explicitly configured to deliver events to multiple targets, then we are done.
                    if (!me.notifyOccluded) {
                        break;
                    }
                }
            }

            if (me.mode) {
                if (outEvts.length) {
                    dragCurrent.b4DragOut(e, outEvts);
                    dragCurrent.onDragOut(e, outEvts);
                }
    
                if (enterEvts.length) {
                    dragCurrent.onDragEnter(e, enterEvts);
                }



( run in 0.426 second using v1.01-cache-2.11-cpan-119454b85a5 )