Roo/bootstrap/Card.js
authorAlan Knowles <alan@roojs.com>
Tue, 17 Nov 2020 06:49:54 +0000 (14:49 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 17 Nov 2020 06:49:54 +0000 (14:49 +0800)
Roo/bootstrap/Card.js

index 132180a..197a45e 100644 (file)
@@ -514,8 +514,37 @@ Roo.extend(Roo.bootstrap.Card, Roo.bootstrap.Component,  {
          
         this.dropPlaceHolder('hide');
         
+        // do the dom manipulation first..
+        var dom = data.source.el.dom;
+        dom.parentNode.removeChild(dom);
+        
+        
+        
         // remove Card from items.
         
+        var old_parent = data.source.parent();
+        
+        old_parent.items = old_parent.items.filter(function(e) { return e != data.source });
+        if (this.items.length) {
+            
+            
+            var nitems = [];
+            for (var i =0; i < this.items; i++) {
+                if (i == target_info.item_n && target_info.position == 'before') {
+                    nitems.push(data.source);
+                }
+                nitems.push(this.items[i]);
+                if (i == target_info.item_n && target_info.position == 'after') {
+                    nitems.push(data.source);
+                }
+            }
+            this.items = nitems;
+        } else {
+            this.items.push(data.source);
+        }
+        
+        
+        //FIXME HANDLE card = true 
         
         // add this to the correct place in items.