Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
Merge branch '1.5.2.3' into 1.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Mak committed Dec 4, 2013
2 parents bc03232 + 367a47c commit 4e94d83
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 31 deletions.
16 changes: 13 additions & 3 deletions build/aui-tree/aui-tree-data-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ TreeData.ATTRS = {
};

A.mix(TreeData.prototype, {
_indexPrimed: false,

childrenLength: 0,

/**
Expand Down Expand Up @@ -143,6 +145,10 @@ A.mix(TreeData.prototype, {
getNodeById: function(uid) {
var instance = this;

if (!instance._indexPrimed) {
instance.refreshIndex();
}

return instance.get(INDEX)[uid];
},

Expand Down Expand Up @@ -217,7 +223,7 @@ A.mix(TreeData.prototype, {
if (moved) {
var output = instance.getEventOutputMap(node);

if (!oldParent.get('children').length) {
if (!oldParent.get(CHILDREN).length) {
oldParent.collapse();
oldParent.hideHitArea();
}
Expand Down Expand Up @@ -283,6 +289,8 @@ A.mix(TreeData.prototype, {
var instance = this;

if (index) {
instance._indexPrimed = true;

instance.set(INDEX, index);
}
},
Expand Down Expand Up @@ -348,7 +356,7 @@ A.mix(TreeData.prototype, {
/**
* Unselect all children of the TreeData.
*
* @method selectAll
* @method unselectAll
*/
unselectAll: function() {
var instance = this;
Expand Down Expand Up @@ -379,7 +387,7 @@ A.mix(TreeData.prototype, {
/**
* Loop each parent node and execute the <code>fn</code> callback.
*
* @method eachChildren
* @method eachParent
* @param {function} fn callback
*/
eachParent: function(fn) {
Expand Down Expand Up @@ -834,6 +842,8 @@ A.mix(TreeData.prototype, {
}
}

instance.registerNode(node);

if (hasOwnerTree) {
ownerTree.registerNode(node);
}
Expand Down
2 changes: 1 addition & 1 deletion build/aui-tree/aui-tree-data-min.js

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

16 changes: 13 additions & 3 deletions build/aui-tree/aui-tree-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ TreeData.ATTRS = {
};

A.mix(TreeData.prototype, {
_indexPrimed: false,

childrenLength: 0,

/**
Expand Down Expand Up @@ -143,6 +145,10 @@ A.mix(TreeData.prototype, {
getNodeById: function(uid) {
var instance = this;

if (!instance._indexPrimed) {
instance.refreshIndex();
}

return instance.get(INDEX)[uid];
},

Expand Down Expand Up @@ -217,7 +223,7 @@ A.mix(TreeData.prototype, {
if (moved) {
var output = instance.getEventOutputMap(node);

if (!oldParent.get('children').length) {
if (!oldParent.get(CHILDREN).length) {
oldParent.collapse();
oldParent.hideHitArea();
}
Expand Down Expand Up @@ -283,6 +289,8 @@ A.mix(TreeData.prototype, {
var instance = this;

if (index) {
instance._indexPrimed = true;

instance.set(INDEX, index);
}
},
Expand Down Expand Up @@ -348,7 +356,7 @@ A.mix(TreeData.prototype, {
/**
* Unselect all children of the TreeData.
*
* @method selectAll
* @method unselectAll
*/
unselectAll: function() {
var instance = this;
Expand Down Expand Up @@ -379,7 +387,7 @@ A.mix(TreeData.prototype, {
/**
* Loop each parent node and execute the <code>fn</code> callback.
*
* @method eachChildren
* @method eachParent
* @param {function} fn callback
*/
eachParent: function(fn) {
Expand Down Expand Up @@ -834,6 +842,8 @@ A.mix(TreeData.prototype, {
}
}

instance.registerNode(node);

if (hasOwnerTree) {
ownerTree.registerNode(node);
}
Expand Down
20 changes: 15 additions & 5 deletions build/aui-tree/aui-tree-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ TreeData.ATTRS = {
};

A.mix(TreeData.prototype, {
_indexPrimed: false,

childrenLength: 0,

/**
Expand Down Expand Up @@ -143,6 +145,10 @@ A.mix(TreeData.prototype, {
getNodeById: function(uid) {
var instance = this;

if (!instance._indexPrimed) {
instance.refreshIndex();
}

return instance.get(INDEX)[uid];
},

Expand Down Expand Up @@ -217,7 +223,7 @@ A.mix(TreeData.prototype, {
if (moved) {
var output = instance.getEventOutputMap(node);

if (!oldParent.get('children').length) {
if (!oldParent.get(CHILDREN).length) {
oldParent.collapse();
oldParent.hideHitArea();
}
Expand Down Expand Up @@ -283,6 +289,8 @@ A.mix(TreeData.prototype, {
var instance = this;

if (index) {
instance._indexPrimed = true;

instance.set(INDEX, index);
}
},
Expand Down Expand Up @@ -348,7 +356,7 @@ A.mix(TreeData.prototype, {
/**
* Unselect all children of the TreeData.
*
* @method selectAll
* @method unselectAll
*/
unselectAll: function() {
var instance = this;
Expand Down Expand Up @@ -379,7 +387,7 @@ A.mix(TreeData.prototype, {
/**
* Loop each parent node and execute the <code>fn</code> callback.
*
* @method eachChildren
* @method eachParent
* @param {function} fn callback
*/
eachParent: function(fn) {
Expand Down Expand Up @@ -834,6 +842,8 @@ A.mix(TreeData.prototype, {
}
}

instance.registerNode(node);

if (hasOwnerTree) {
ownerTree.registerNode(node);
}
Expand Down Expand Up @@ -3563,13 +3573,13 @@ var TreeViewDD = A.Component.create(
}
else if (dropAction === APPEND) {
if (dropTreeNode && !dropTreeNode.isLeaf()) {
dropTreeNode.appendChild(dragTreeNode);

if (!dropTreeNode.get(EXPANDED)) {
// expand node when drop a child on it
dropTreeNode.expand();
}

dropTreeNode.appendChild(dragTreeNode);

instance.bubbleEvent('dropAppend', output);
}
}
Expand Down
Loading

0 comments on commit 4e94d83

Please sign in to comment.