mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-02-16 02:30:51 +00:00
Fix edges direction field for xml export.
This commit is contained in:
@@ -1074,10 +1074,12 @@ Graph.prototype.LoadFromXML = function (xmlText, additionalData)
|
||||
|
||||
var loadedGraphId = 0;
|
||||
var loadedEdgeId = 0;
|
||||
var defaultLoadEdges = "";
|
||||
|
||||
$graphs.each(function(){
|
||||
loadedGraphId = parseInt($(this).attr('uidGraph'));
|
||||
loadedEdgeId = parseInt($(this).attr('uidEdge'));
|
||||
defaultLoadEdges = $(this).attr('edgedefault');
|
||||
});
|
||||
|
||||
// Backward compatibility
|
||||
@@ -1089,6 +1091,11 @@ Graph.prototype.LoadFromXML = function (xmlText, additionalData)
|
||||
loadedEdgeId = this.edgesOffset;
|
||||
}
|
||||
|
||||
if (defaultLoadEdges != "directed" && defaultLoadEdges != "undirected")
|
||||
{
|
||||
defaultLoadEdges = "undirected";
|
||||
}
|
||||
|
||||
this.uidGraph = loadedGraphId;
|
||||
this.uidEdge = loadedEdgeId;
|
||||
|
||||
@@ -1109,7 +1116,7 @@ Graph.prototype.LoadFromXML = function (xmlText, additionalData)
|
||||
var graph = this;
|
||||
$edges.each(function(){
|
||||
var edge = new BaseEdge();
|
||||
edge.LoadFromXML($(this), graph);
|
||||
edge.LoadFromXML($(this), graph, defaultLoadEdges);
|
||||
// Fix case with wrong id.
|
||||
if (edge.id < graph.uidEdge) {
|
||||
edge.id = graph.uidEdge;
|
||||
|
||||
Reference in New Issue
Block a user