X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..HEAD:/docs/source/DD.html diff --git a/docs/source/DD.html b/docs/source/DD.html index 52a7ff97..693d66cf 100644 --- a/docs/source/DD.html +++ b/docs/source/DD.html @@ -1,4 +1,21 @@ -Sencha Documentation Project
/*
+
+
+
+  
+  The source code
+  
+  
+  
+  
+
+
+  
/*
  * This is a derivative of the similarly named class in the YUI Library.
  * The original license:
  * Copyright (c) 2006, Yahoo! Inc. All rights reserved.
@@ -7,43 +24,44 @@
  */
 
 
-/**
- * @class Ext.dd.DD
+/**
+ * @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.define('Ext.dd.DD', {
     extend: 'Ext.dd.DragDrop',
     requires: ['Ext.dd.DragDropManager'],
+
+    /**
+     * Creates new DD instance.
+     * @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
+     */
     constructor: function(id, sGroup, config) {
         if (id) {
             this.init(id, sGroup, config);
         }
     },
 
-    /**
+    /**
      * When set to true, the utility automatically tries to scroll the browser
      * window when a drag and drop element is dragged near the viewport boundary.
      * Defaults to true.
      * @property scroll
-     * @type boolean
+     * @type Boolean
      */
     scroll: true,
 
-    /**
+    /**
      * Sets the pointer offset to the distance between the linked element's top
      * left corner and the location the element was clicked
      * @method autoOffset
-     * @param {int} iPageX the X coordinate of the click
-     * @param {int} iPageY the Y coordinate of the click
+     * @param {Number} iPageX the X coordinate of the click
+     * @param {Number} iPageY the Y coordinate of the click
      */
     autoOffset: function(iPageX, iPageY) {
         var x = iPageX - this.startPageX;
@@ -51,27 +69,27 @@ Ext.define('Ext.dd.DD', {
         this.setDelta(x, y);
     },
 
-    /**
+    /**
      * Sets the pointer offset.  You can call this directly to force the
      * offset to be in a particular location (e.g., pass in 0,0 to set it
      * to the center of the object)
      * @method setDelta
-     * @param {int} iDeltaX the distance from the left
-     * @param {int} iDeltaY the distance from the top
+     * @param {Number} iDeltaX the distance from the left
+     * @param {Number} iDeltaY the distance from the top
      */
     setDelta: function(iDeltaX, iDeltaY) {
         this.deltaX = iDeltaX;
         this.deltaY = iDeltaY;
     },
 
-    /**
+    /**
      * Sets the drag element to the location of the mousedown or click event,
      * maintaining the cursor location relative to the location on the element
      * that was clicked.  Override this if you want to place the element in a
      * location other than where the cursor is.
      * @method setDragElPos
-     * @param {int} iPageX the X coordinate of the mousedown or drag event
-     * @param {int} iPageY the Y coordinate of the mousedown or drag event
+     * @param {Number} iPageX the X coordinate of the mousedown or drag event
+     * @param {Number} iPageY the Y coordinate of the mousedown or drag event
      */
     setDragElPos: function(iPageX, iPageY) {
         // the first time we do this, we are going to check to make sure
@@ -81,21 +99,21 @@ Ext.define('Ext.dd.DD', {
         this.alignElWithMouse(el, iPageX, iPageY);
     },
 
-    /**
+    /**
      * Sets the element to the location of the mousedown or click event,
      * maintaining the cursor location relative to the location on the element
      * that was clicked.  Override this if you want to place the element in a
      * location other than where the cursor is.
      * @method alignElWithMouse
      * @param {HTMLElement} el the element to move
-     * @param {int} iPageX the X coordinate of the mousedown or drag event
-     * @param {int} iPageY the Y coordinate of the mousedown or drag event
+     * @param {Number} iPageX the X coordinate of the mousedown or drag event
+     * @param {Number} iPageY the Y coordinate of the mousedown or drag event
      */
     alignElWithMouse: function(el, iPageX, iPageY) {
         var oCoord = this.getTargetCoord(iPageX, iPageY),
             fly = el.dom ? el : Ext.fly(el, '_dd'),
             elSize = fly.getSize(),
-            EL = Ext.core.Element,
+            EL = Ext.Element,
             vpSize;
 
         if (!this.deltaSetXY) {
@@ -121,14 +139,14 @@ Ext.define('Ext.dd.DD', {
         return oCoord;
     },
 
-    /**
+    /**
      * Saves the most recent position so that we can reset the constraints and
      * tick marks on-demand.  We need to know this so that we can calculate the
      * number of pixels the element is offset from its original position.
      * @method cachePosition
-     * @param iPageX the current x position (optional, this just makes it so we
+     * @param {Number} iPageX (optional) the current x position (this just makes it so we
      * don't have to look it up again)
-     * @param iPageY the current y position (optional, this just makes it so we
+     * @param {Number} iPageY (optional) the current y position (this just makes it so we
      * don't have to look it up again)
      */
     cachePosition: function(iPageX, iPageY) {
@@ -136,30 +154,30 @@ Ext.define('Ext.dd.DD', {
             this.lastPageX = iPageX;
             this.lastPageY = iPageY;
         } else {
-            var aCoord = Ext.core.Element.getXY(this.getEl());
+            var aCoord = Ext.Element.getXY(this.getEl());
             this.lastPageX = aCoord[0];
             this.lastPageY = aCoord[1];
         }
     },
 
-    /**
+    /**
      * Auto-scroll the window if the dragged object has been moved beyond the
      * visible window boundary.
      * @method autoScroll
-     * @param {int} x the drag element's x position
-     * @param {int} y the drag element's y position
-     * @param {int} h the height of the drag element
-     * @param {int} w the width of the drag element
+     * @param {Number} x the drag element's x position
+     * @param {Number} y the drag element's y position
+     * @param {Number} h the height of the drag element
+     * @param {Number} w the width of the drag element
      * @private
      */
     autoScroll: function(x, y, h, w) {
 
         if (this.scroll) {
             // The client height
-            var clientH = Ext.core.Element.getViewHeight();
+            var clientH = Ext.Element.getViewHeight();
 
             // The client width
-            var clientW = Ext.core.Element.getViewWidth();
+            var clientW = Ext.Element.getViewWidth();
 
             // The amt scrolled down
             var st = this.DDMInstance.getScrollTop();
@@ -217,12 +235,12 @@ Ext.define('Ext.dd.DD', {
         }
     },
 
-    /**
+    /**
      * Finds the location the element should be placed if we want to move
      * it to where the mouse location less the click offset would place us.
      * @method getTargetCoord
-     * @param {int} iPageX the X coordinate of the click
-     * @param {int} iPageY the Y coordinate of the click
+     * @param {Number} iPageX the X coordinate of the click
+     * @param {Number} iPageY the Y coordinate of the click
      * @return an object that contains the coordinates (Object.x and Object.y)
      * @private
      */
@@ -255,7 +273,7 @@ Ext.define('Ext.dd.DD', {
         return {x: x, y: y};
     },
 
-    /**
+    /**
      * Sets up config options specific to this class. Overrides
      * Ext.dd.DragDrop, but all versions of this method through the
      * inheritance chain are called
@@ -265,7 +283,7 @@ Ext.define('Ext.dd.DD', {
         this.scroll = (this.config.scroll !== false);
     },
 
-    /**
+    /**
      * Event that fires prior to the onMouseDown event.  Overrides
      * Ext.dd.DragDrop.
      */
@@ -274,7 +292,7 @@ Ext.define('Ext.dd.DD', {
         this.autoOffset(e.getPageX(), e.getPageY());
     },
 
-    /**
+    /**
      * Event that fires prior to the onDrag event.  Overrides
      * Ext.dd.DragDrop.
      */
@@ -314,4 +332,6 @@ Ext.define('Ext.dd.DD', {
     */
 
 });
-
\ No newline at end of file +
+ +