mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 22:27:55 +01:00
Do not serialize isolated relationships.
This commit is contained in:
parent
396ed9a147
commit
39a8fc1891
@ -47,11 +47,16 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
|||||||
// Create Relationships
|
// Create Relationships
|
||||||
var relationships = mindmap.getRelationships();
|
var relationships = mindmap.getRelationships();
|
||||||
if (relationships.length > 0) {
|
if (relationships.length > 0) {
|
||||||
|
|
||||||
for (var j = 0; j < relationships.length; j++) {
|
for (var j = 0; j < relationships.length; j++) {
|
||||||
var relationDom = this._relationshipToXML(document, relationships[j]);
|
var relationship = relationships[j];
|
||||||
|
if (mindmap.findNodeById(relationship.getFromNode()) !== null && mindmap.findNodeById(relationship.getToNode()) !== null) {
|
||||||
|
// Isolated relationships are not persisted ....
|
||||||
|
var relationDom = this._relationshipToXML(document, relationship);
|
||||||
mapElem.appendChild(relationDom);
|
mapElem.appendChild(relationDom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return document;
|
return document;
|
||||||
},
|
},
|
||||||
@ -180,6 +185,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
|||||||
result.setAttribute("srcTopicId", relationship.getFromNode());
|
result.setAttribute("srcTopicId", relationship.getFromNode());
|
||||||
result.setAttribute("destTopicId", relationship.getToNode());
|
result.setAttribute("destTopicId", relationship.getToNode());
|
||||||
|
|
||||||
|
|
||||||
var lineType = relationship.getLineType();
|
var lineType = relationship.getLineType();
|
||||||
result.setAttribute("lineType", lineType);
|
result.setAttribute("lineType", lineType);
|
||||||
if (lineType == mindplot.ConnectionLine.CURVED || lineType == mindplot.ConnectionLine.SIMPLE_CURVED) {
|
if (lineType == mindplot.ConnectionLine.CURVED || lineType == mindplot.ConnectionLine.SIMPLE_CURVED) {
|
||||||
@ -305,7 +311,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
var order = domElem.getAttribute('order');
|
var order = domElem.getAttribute('order');
|
||||||
if ($defined(order) && order!="NaN") { // Hack for broken maps ...
|
if ($defined(order) && order != "NaN") { // Hack for broken maps ...
|
||||||
topic.setOrder(parseInt(order));
|
topic.setOrder(parseInt(order));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user