Index: pro-violet-viettel/www/deploy/20150304/assets/js/manager.js
===================================================================
--- pro-violet-viettel/www/deploy/20150304/assets/js/manager.js	(revision 858)
+++ pro-violet-viettel/www/deploy/20150304/assets/js/manager.js	(revision 859)
@@ -408,4 +408,5 @@
 
                                 }
+                                
                                 var btnDownloadClick = function () {
                                     var items = o.oGrid.getHighLightItem();
@@ -593,7 +594,9 @@
                                     return bootbox.dialog(promptOptions);
                                 }
+                                
                                 var uploadDone = function (result) {
 
                                 }
+                                
                                 var btnPreviewClick = function () {
                                     var items = o.oGrid.getHighLightItem();
@@ -920,9 +923,10 @@
                                     var destination = self.getTreeCurrentNode();
                                     if (oClipBoard.act != 'copy') {
-                                        $(oClipBoard.items).each(
+                                        /*$(oClipBoard.items).each(
                                                 function (index) {
                                                     var node = new Object;
                                                     if (this.type == 'directory')
                                                         buildTreeFromParent(this.id, node);
+                                                    	
                                                     else {
                                                         node.id = this.id;
@@ -931,14 +935,20 @@
 
                                                     items[index] = node;
-                                                });
+                                                });*/
+                                    	
                                     } else {
                                         items = oClipBoard.items;
                                     }
-
-                                    for (var i = 0; i < items.length; i++) {
+                                    
+                                    var aryTree = [];
+                                    aryTree = self.buildDirectoriesTree(items[0].id);
+                                    console.log(aryTree);
+                                    return;
+
+                                    /*for (var i = 0; i < items.length; i++) {
                                         if (items[i].type == 'directory') {
                                             items[i] = self.getAllDirChilds(items[i]);
                                         }
-                                    }
+                                    }*/
 
                                     var postdata = {
@@ -1132,6 +1142,7 @@
                                     if (o.oGrid)
                                         o.oGrid.reloadGrid();
-                                };
-
+                                }
+
+                                
                                 this.getTreeCurrentNode = function () {
                                     return treeCurrentNode;
@@ -1300,4 +1311,22 @@
                                 }
 
+                                this.buildDirectoriesTree = function (parentID) {
+                                	if (parentID == null) parentID = 0;
+                                	var aryDirs = o.data.DIRECTORIES;
+                                	var branch = [];
+                                	var children = [];
+                                	for (var i = 0; i < aryDirs.length; i++) {
+                                		if (aryDirs[i].parentID == parentID) {
+                                			children = self.buildDirectoriesTree(aryDirs[i].id);
+                                			if (children.length > 0) {
+                                				aryDirs[i].childDirs = children; 
+                                			}
+                                			branch.push(aryDirs[i]);
+                                		}
+                                	}
+                                	
+                                	return branch;
+                                }
+                                
                                 this.initialize = function () {
                                     init();
