targetPath = target.attributes.path + '/';
treeIsTarget = true;
}
+ else if (target.path) {
+ targetPath = target.path + (target.type == 'folder' ? '/' : '');
+ }
for(var i=0; i<items.length; i++) {
var item = items[i];
}
// add / remount node
- me.expandPath(parentPath, '', function(sucess, parentNode) {
- var childNode = parentNode.findChild('name', data.name);
- if (! childNode) {
- parentNode.appendChild(node || me.loader.createNode(data));
- } else if (childNode != node) {
- // node got duplicated by expand load
- try {
- node.cancelExpand();
- node.remove(true);
- } catch (e) {}
- }
- });
+ try {
+ me.expandPath(parentPath, '', function (sucess, parentNode) {
+ var childNode = parentNode.findChild('name', data.name);
+ if (!childNode) {
+ parentNode.appendChild(node || me.loader.createNode(data));
+ } else if (childNode != node) {
+ // node got duplicated by expand load
+ try {
+ node.cancelExpand();
+ node.remove(true);
+ } catch (e) {
+ }
+ }
+ });
+ } catch (e) {}
}
},
filePickerDialog.on('selected', function(nodes) {
var node = nodes[0];
- Tine.Filemanager.fileRecordBackend.copyNodes(records, node.path, true);
+ Tine.Filemanager.fileRecordBackend.copyNodes(records, node, true);
});
filePickerDialog.openWindow();
- },
+ }
};
/**
}
}
});
+
+Ext.override(Ext.tree.TreePanel, {
+ /**
+ * Gets a node in this tree by its id
+ * @param {String} id
+ * @return {Node}
+ */
+ getNodeById : function(id){
+ try {
+ return this.nodeHash[id];
+ } catch(e) {
+ return null;
+ }
+ }
+});