0012376: can't move node to parent dir
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 28 Nov 2016 12:16:21 +0000 (13:16 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 30 Nov 2016 14:57:38 +0000 (15:57 +0100)
* removes obsolete isSubPath code that never
 prevented any problems...

https://forge.tine20.org/view.php?id=12376

Change-Id: If023572b7e98711687af31cbb26207e53d632ea5
Reviewed-on: http://gerrit.tine20.com/customers/3893
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Filemanager/js/NodeTreePanel.js

index b101996..c9a4000 100644 (file)
@@ -85,8 +85,6 @@ Ext.extend(Tine.Filemanager.NodeTreePanel, Tine.widgets.container.TreePanel, {
                     for (var i=0; i<dd.dragData.selections.length; i++) {
                         if (n.node.id == dd.dragData.selections[i].id) {
                             preventDrop = true;
-                        } else if (this.isSubPath(dd.dragData.selections[i].data.path, n.node.attributes.path)) {
-                            preventDrop = true;
                         }
                         if(dd.dragData.selections[i].data.type == 'file') {
                             selectionContainsFiles = true;
@@ -123,8 +121,6 @@ Ext.extend(Tine.Filemanager.NodeTreePanel, Tine.widgets.container.TreePanel, {
                     for(var i=0; i<dd.dragData.selections.length; i++) {
                         if (n.node.id == dd.dragData.selections[i].id) {
                             preventDrop = true;
-                        } else if (this.isSubPath(dd.dragData.selections[i].data.path, n.node.attributes.path)) {
-                            preventDrop = true;
                         }
     
                         if(dd.dragData.selections[i].data.type == 'file') {
@@ -154,30 +150,8 @@ Ext.extend(Tine.Filemanager.NodeTreePanel, Tine.widgets.container.TreePanel, {
                 t.ui.endDrop();
                 this.tree.fireEvent("nodedrop", de);
             },
-            
-            /**
-             * checks if the path needle is a sub path of haystack
-             */
-            isSubPath: function(haystack, needle) {
-                var h = haystack.split('/');
-                var n = needle.split('/');
-                var res = true;
-                
-                for (var index = 0; index < h.length; index++) {
-                    
-                    if (n.length <= index) {
-                        break;
-                    }
-                    
-                    if (h[index] != n[index]) {
-                        res = false;
-                    }
-                }
-                
-                return res;
-            }
         };
-        
+
         this.dragConfig = {
             ddGroup: this.ddGroup || 'fileDDGroup',
             scroll: this.ddScroll,