Commit 50447482 authored by 张博's avatar 张博

修复了复制粘贴带子节点的节点时发生错误的问题

parent 29b4f267
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "kityminder-core", "name": "kityminder-core",
"title": "Kity Minder Core", "title": "Kity Minder Core",
"description": "Powerful online mind graphic visualization and editor (command based)", "description": "Powerful online mind graphic visualization and editor (command based)",
"version": "1.4.12", "version": "1.4.13",
"main": [ "main": [
"release/kityminder.core.min.js", "release/kityminder.core.min.js",
"release/kityminder.core.css" "release/kityminder.core.css"
......
/*! /*!
* ==================================================== * ====================================================
* kityminder - v1.4.1 - 2015-07-22 * kityminder - v1.4.1 - 2015-08-05
* https://github.com/fex-team/kityminder-core * https://github.com/fex-team/kityminder-core
* GitHub: https://github.com/fex-team/kityminder-core.git * GitHub: https://github.com/fex-team/kityminder-core.git
* Copyright (c) 2015 Baidu FEX; Licensed MIT * Copyright (c) 2015 Baidu FEX; Licensed MIT
...@@ -4270,6 +4270,13 @@ _p[42] = { ...@@ -4270,6 +4270,13 @@ _p[42] = {
var children = child.children.map(function(node) { var children = child.children.map(function(node) {
return node.clone(); return node.clone();
}); });
/*
* fixed bug: Modified on 2015.08.05
* 原因:粘贴递归 append 时没有清空原来父节点的子节点,而父节点被复制的时候,是连同子节点一起复制过来的
* 解决办法:增加了下面这一行代码
* by: @zhangbobell zhangbobell@163.com
*/
child.clearChildren();
for (var i = 0, ci; ci = children[i]; i++) { for (var i = 0, ci; ci = children[i]; i++) {
appendChildNode(child, ci); appendChildNode(child, ci);
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -20,6 +20,15 @@ define(function(require, exports, module) { ...@@ -20,6 +20,15 @@ define(function(require, exports, module) {
var children = child.children.map(function(node) { var children = child.children.map(function(node) {
return node.clone(); return node.clone();
}); });
/*
* fixed bug: Modified on 2015.08.05
* 原因:粘贴递归 append 时没有清空原来父节点的子节点,而父节点被复制的时候,是连同子节点一起复制过来的
* 解决办法:增加了下面这一行代码
* by: @zhangbobell zhangbobell@163.com
*/
child.clearChildren();
for (var i = 0, ci; for (var i = 0, ci;
(ci = children[i]); i++) { (ci = children[i]); i++) {
appendChildNode(child, ci); appendChildNode(child, ci);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment