fix XMLSerializer_Pela appendChild error

This commit is contained in:
Ezequiel Bergamaschi 2014-06-16 01:36:13 -03:00
parent a862a8ec3d
commit 332ef31597

View File

@ -34,14 +34,14 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
mapElem.setAttribute('version', version); mapElem.setAttribute('version', version);
} }
document.append(mapElem); document.appendChild(mapElem);
// Create branches ... // Create branches ...
var topics = mindmap.getBranches(); var topics = mindmap.getBranches();
for (var i = 0; i < topics.length; i++) { for (var i = 0; i < topics.length; i++) {
var topic = topics[i]; var topic = topics[i];
var topicDom = this._topicToXML(document, topic); var topicDom = this._topicToXML(document, topic);
mapElem.append(topicDom); mapElem.appendChild(topicDom);
} }
// Create Relationships // Create Relationships
@ -53,7 +53,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
if (mindmap.findNodeById(relationship.getFromNode()) !== null && mindmap.findNodeById(relationship.getToNode()) !== null) { if (mindmap.findNodeById(relationship.getFromNode()) !== null && mindmap.findNodeById(relationship.getToNode()) !== null) {
// Isolated relationships are not persisted .... // Isolated relationships are not persisted ....
var relationDom = this._relationshipToXML(document, relationship); var relationDom = this._relationshipToXML(document, relationship);
mapElem.append(relationDom); mapElem.appendChild(relationDom);
} }
} }
} }
@ -150,12 +150,12 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
var value = attributes[key]; var value = attributes[key];
if (key == 'text') { if (key == 'text') {
var cdata = document.createCDATASection(this.rmXmlInv(value)); var cdata = document.createCDATASection(this.rmXmlInv(value));
featureDom.append(cdata); featureDom.appendChild(cdata);
} else { } else {
featureDom.setAttribute(key, this.rmXmlInv(value)); featureDom.setAttribute(key, this.rmXmlInv(value));
} }
} }
parentTopic.append(featureDom); parentTopic.appendChild(featureDom);
} }
//CHILDREN TOPICS //CHILDREN TOPICS
@ -163,7 +163,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
for (var j = 0; j < childTopics.length; j++) { for (var j = 0; j < childTopics.length; j++) {
var childTopic = childTopics[j]; var childTopic = childTopics[j];
var childDom = this._topicToXML(document, childTopic); var childDom = this._topicToXML(document, childTopic);
parentTopic.append(childDom); parentTopic.appendChild(childDom);
} }
return parentTopic; return parentTopic;
@ -175,8 +175,8 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
} else { } else {
var textDom = document.createElement("text"); var textDom = document.createElement("text");
var cdata = document.createCDATASection(this.rmXmlInv(text)); var cdata = document.createCDATASection(this.rmXmlInv(text));
textDom.append(cdata); textDom.appendChild(cdata);
elem.append(textDom); elem.appendChild(textDom);
} }
}, },