Skip to content

Commit

Permalink
Merge branch 'master' of yuisource.corp.yahoo.com:yui3
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrove committed Jun 27, 2011
2 parents 91faf4f + fcdb791 commit 2f33e4a
Show file tree
Hide file tree
Showing 43 changed files with 935 additions and 259 deletions.
3 changes: 2 additions & 1 deletion build/dd-delegate/dd-delegate-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ YUI.add('dd-delegate', function(Y) {
initializer: function(cfg) {
this._handles = [];
//Create a tmp DD instance under the hood.
var conf = Y.clone(this.get('dragConfig') || {}),
//var conf = Y.clone(this.get('dragConfig') || {}),
var conf = this.get('dragConfig') || {},
cont = this.get(CONT);

conf.node = _tmpNode.cloneNode(true);
Expand Down
2 changes: 1 addition & 1 deletion build/dd-delegate/dd-delegate-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion build/dd-delegate/dd-delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ YUI.add('dd-delegate', function(Y) {
initializer: function(cfg) {
this._handles = [];
//Create a tmp DD instance under the hood.
var conf = Y.clone(this.get('dragConfig') || {}),
//var conf = Y.clone(this.get('dragConfig') || {}),
var conf = this.get('dragConfig') || {},
cont = this.get(CONT);

conf.node = _tmpNode.cloneNode(true);
Expand Down
21 changes: 21 additions & 0 deletions build/dd-drag/dd-drag-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ YUI.add('dd-drag', function(Y) {
*/
node: {
setter: function(node) {
if (this._canDrag(node)) {
return node;
}
var n = Y.one(node);
if (!n) {
Y.error('DD.Drag: Invalid Node Given: ' + node);
Expand All @@ -232,6 +235,9 @@ YUI.add('dd-drag', function(Y) {
*/
dragNode: {
setter: function(node) {
if (this._canDrag(node)) {
return node;
}
var n = Y.one(node);
if (!n) {
Y.error('DD.Drag: Invalid dragNode Given: ' + node);
Expand Down Expand Up @@ -433,6 +439,21 @@ YUI.add('dd-drag', function(Y) {
};

Y.extend(Drag, Y.Base, {
/**
* Checks the object for the methods needed to drag the object around.
* Normally this would be a node instance, but in the case of Graphics, it
* may be an SVG node or something similar.
* @method _canDrag
* @private
* @param {Object} n The object to check
* @return {Boolean} True or false if the Object contains the methods needed to Drag
*/
_canDrag: function(n) {
if (n && n.setXY && n.getXY && n.test && n.contains) {
return true;
}
return false;
},
/**
* @private
* @property _bubbleTargets
Expand Down
Loading

0 comments on commit 2f33e4a

Please sign in to comment.