mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-24 06:57:56 +01:00
- Fix position on Beta version maps during loading ...
This commit is contained in:
parent
63113a529d
commit
a3d129a034
@ -118,6 +118,7 @@ mindplot.model.INodeModel = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
setOrder : function(value) {
|
setOrder : function(value) {
|
||||||
|
$assert(typeof value === 'number' && isFinite(value) || value == null, "Order must be null or a number");
|
||||||
this.putProperty('order', value);
|
this.putProperty('order', value);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ mindplot.persistence.Pela2TangoMigrator = new Class({
|
|||||||
var mindmap = this._pelaSerializer.loadFromDom(dom, mapId);
|
var mindmap = this._pelaSerializer.loadFromDom(dom, mapId);
|
||||||
mindmap.setVersion(mindplot.persistence.ModelCodeName.TANGO);
|
mindmap.setVersion(mindplot.persistence.ModelCodeName.TANGO);
|
||||||
this._fixOrder(mindmap);
|
this._fixOrder(mindmap);
|
||||||
|
this._fixPosition(mindmap);
|
||||||
return mindmap;
|
return mindmap;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -56,11 +57,38 @@ mindplot.persistence.Pela2TangoMigrator = new Class({
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (i = 0; i < rightNodes.length; i++) {
|
for (i = 0; i < rightNodes.length; i++) {
|
||||||
rightNodes[i].setOrder(i*2);
|
rightNodes[i].setOrder(i * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < leftNodes.length; i++) {
|
for (i = 0; i < leftNodes.length; i++) {
|
||||||
leftNodes[i].setOrder(i*2+1);
|
leftNodes[i].setOrder(i * 2 + 1);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_fixPosition : function(mindmap) {
|
||||||
|
// Position was not required in previous versions. Try to synthesize one .
|
||||||
|
var centralNode = mindmap.getBranches()[0];
|
||||||
|
var children = centralNode.getChildren();
|
||||||
|
for (var i = 0; i < children.length; i++) {
|
||||||
|
var child = children[i];
|
||||||
|
var position = child.getPosition();
|
||||||
|
this._fixNodePosition(child, position)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_fixNodePosition : function(node, parentPosition) {
|
||||||
|
// Position was not required in previous versions. Try to synthesize one .
|
||||||
|
var position = node.getPosition();
|
||||||
|
if (!position) {
|
||||||
|
position = {x:parentPosition.x + 30,y:parentPosition.y};
|
||||||
|
node.setPosition(position.x, position.y);
|
||||||
|
}
|
||||||
|
var children = node.getChildren();
|
||||||
|
for (var i = 0; i < children.length; i++) {
|
||||||
|
var child = children[i];
|
||||||
|
this._fixNodePosition(child, position);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -195,7 +195,7 @@ mindplot.persistence.XMLSerializer_Beta = new Class({
|
|||||||
|
|
||||||
var order = domElem.getAttribute('order');
|
var order = domElem.getAttribute('order');
|
||||||
if ($defined(order)) {
|
if ($defined(order)) {
|
||||||
topic.setOrder(order);
|
topic.setOrder(parseInt(order));
|
||||||
}
|
}
|
||||||
|
|
||||||
var shape = domElem.getAttribute('shape');
|
var shape = domElem.getAttribute('shape');
|
||||||
|
4
wise-webapp/doc/Compile.md
Normal file
4
wise-webapp/doc/Compile.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Compilation and Execution
|
||||||
|
|
||||||
|
Your will find all the steps and required documentation here: http://www.wisemapping.org/downloads/source
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
# SMTP Server Configurat
|
|
Loading…
Reference in New Issue
Block a user