From 5d1c0e31ee7a52fbf4e058d6d090c32d8b8933a0 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 17 Nov 2020 14:49:54 +0800 Subject: [PATCH] Roo/bootstrap/Card.js --- Roo/bootstrap/Card.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Roo/bootstrap/Card.js b/Roo/bootstrap/Card.js index 132180a358..197a45eea8 100644 --- a/Roo/bootstrap/Card.js +++ b/Roo/bootstrap/Card.js @@ -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. -- 2.39.2