dd-proxy-debug.js revision aeb77d2edf9d5bb8a95885ad6ed90ca5ad0970d7
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * Plugin for dd-drag for creating a proxy drag node, instead of dragging the original node.
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @module dd
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @submodule dd-proxy
a89ad754cce3cfc8aee71760e10217b54020360dTripp * Plugin for dd-drag for creating a proxy drag node, instead of dragging the original node.
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @class DDProxy
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @extends Base
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @constructor
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @namespace Plugin
a89ad754cce3cfc8aee71760e10217b54020360dTripp P = function(config) {
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @property NS
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @default con
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @readonly
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @protected
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @description The Proxy instance will be placed on the Drag instance under the proxy namespace.
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @type {String}
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @attribute moveOnEnd
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @description Move the original node at the end of the drag. Default: true
7947db4b7d8682ea81598e3a4283e659a8103be6Tripp * @type Boolean
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @attribute hideOnEnd
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @description Hide the drag node at the end of the drag. Default: true
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @type Boolean
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @attribute resizeFrame
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @description Make the Proxy node assume the size of the original node. Default: true
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @type Boolean
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @attribute positionProxy
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @description Make the Proxy node appear in the same place as the original node. Default: true
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @type Boolean
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @attribute borderStyle
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @description The default border style for the border of the proxy. Default: 1px solid #808080
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @type Boolean
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @attribute cloneNode
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @description Should the node be cloned into the proxy for you. Default: false
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @type Boolean
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @property _hands
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @description Holds the event handles for setting the proxy
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @method _init
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @description Handler for the proxy config attribute
a89ad754cce3cfc8aee71760e10217b54020360dTripp _init: function() {
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp if (!this._hands) {
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp var h, h1, host = this.get(HOST), dnode = host.get(DRAG_NODE);
a89ad754cce3cfc8aee71760e10217b54020360dTripp initializer: function() {
a89ad754cce3cfc8aee71760e10217b54020360dTripp destructor: function() {
a89ad754cce3cfc8aee71760e10217b54020360dTripp clone: function() {
a89ad754cce3cfc8aee71760e10217b54020360dTripp c = n.cloneNode(true);
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp //Add a couple of methods to the DDM
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @namespace DD
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @method _createFrame
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @description Create the proxy element if it doesn't already exist and set the DD.DDM._proxy value
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp _createFrame: function() {
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @namespace DD
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @method _setFrame
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @description If resizeProxy is set to true (default) it will resize the proxy element to match the size of the Drag Element.
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * If positionProxy is set to true (default) it will position the proxy element in the same location as the Drag Element.
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp var n = drag.get(NODE), d = drag.get(DRAG_NODE), ah, cur = 'auto';
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp //Create the frame when DOM is ready
a89ad754cce3cfc8aee71760e10217b54020360dTripp //Y.on('domready', Y.bind(DDM._createFrame, DDM));
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp}, '@VERSION@' ,{requires:['dd-ddm', 'dd-drag'], skinnable:false});