- Change forEach for each interator

- Fix issue deleting nodes with intermediate relationships
This commit is contained in:
Paulo Gustavo Veiga
2012-07-08 19:31:21 -03:00
parent 8175eea928
commit 39c2b37a1f
24 changed files with 521 additions and 508 deletions

View File

@@ -135,7 +135,7 @@ mindplot.model.IMindmap = new Class({
// Then the rest of the branches ...
var sbranchs = source.getBranches();
sbranchs.forEach(function(snode) {
sbranchs.each(function(snode) {
var tnode = target.createNode(snode.getType(), snode.getId());
snode.copyTo(tnode);
target.addBranch(tnode);

View File

@@ -213,7 +213,7 @@ mindplot.model.INodeModel = new Class({
var source = this;
// Copy properties ...
var keys = source.getPropertiesKeys();
keys.forEach(function(key) {
keys.each(function(key) {
var value = source.getProperty(key);
target.putProperty(key, value);
});
@@ -222,7 +222,7 @@ mindplot.model.INodeModel = new Class({
var children = this.getChildren();
var tmindmap = target.getMindmap();
children.forEach(function(snode) {
children.each(function(snode) {
var tnode = tmindmap.createNode(snode.getType(), snode.getId());
snode.copyTo(tnode);
target.appendChild(tnode);
@@ -278,10 +278,10 @@ mindplot.model.INodeModel = new Class({
var children = this.getChildren();
if (children.length > 0) {
result = result + ", children: {(size:" + children.length;
children.forEach(function(node) {
children.each(function(node) {
result = result + "=> (";
var keys = node.getPropertiesKeys();
keys.forEach(function(key) {
keys.each(function(key) {
var value = node.getProperty(key);
result = result + key + ":" + value + ",";
});