Pman.Builder.Tree.js
authorAlan Knowles <alan@roojs.com>
Thu, 30 Jan 2014 07:33:07 +0000 (15:33 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 30 Jan 2014 07:33:07 +0000 (15:33 +0800)
Pman.Builder.Tree.js

index e7df497..09c7bd3 100644 (file)
@@ -182,11 +182,12 @@ Pman.Builder.Tree = {
         }
         if (!ix) {
             // first..
-            this.appendNode(pn.childNodes[0], cfg, 'before');
+            this.appendNode(pn.childNodes[0], cfg, 'above');
             return true;
         
         }
-        this.appendNode(pn.childNodes[ix-1], cfg, 'after');
+        
+        this.appendNode(pn.childNodes[ix-1], cfg, 'below');
         
         
         return true;
@@ -404,9 +405,12 @@ Pman.Builder.Tree = {
         }
         // can append has to use palete...
         // this code should be in nodedragover.
-        
-        Roo.log("move checks need moving");
-        return false;
+        if (e.dropNode) {
+            var cfg = this.toJS(e.dropNode);
+            this.appendNode(e.target, cfg, e.point);
+        }
+        Roo.log('no e.dropNode?');
+        return false; // do not allow movement..
         
         if (_this.canAppend(np, e.dropNode.elConfig)) {
             if (e.rawEvent.ctrlKey) {
@@ -478,7 +482,16 @@ Pman.Builder.Tree = {
            // done all the checks...
            return;
            
-       }
+        }
+        
+        
+        // have a drop node - hence comming from the same object..
+        var drop_xtype = this.nodeXtype(e.dropNode);
+        // currently we can not determine validity..
+        e.cancel = false;
+        return ;
+        
+        
         
     },
     save : function()