mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
refactoring layout - fixing bugs
This commit is contained in:
parent
741ddef314
commit
55f9352c59
@ -20,8 +20,7 @@ mindplot.MainTopic = function(model)
|
||||
{
|
||||
core.assert(model, "Model can not be null");
|
||||
this.setModel(model);
|
||||
var topicBoard = new mindplot.MainTopicBoard(this);
|
||||
mindplot.MainTopic.superClass.initialize.call(this, topicBoard);
|
||||
mindplot.MainTopic.superClass.initialize.call(this);
|
||||
};
|
||||
|
||||
objects.extend(mindplot.MainTopic, mindplot.Topic);
|
||||
|
@ -455,6 +455,25 @@ mindplot.MindmapDesigner.prototype._nodeModelToNodeGraph = function(nodeModel, i
|
||||
|
||||
var children = nodeModel.getChildren().slice();
|
||||
|
||||
// Sort children by order to solve adding order in for OriginalLayoutManager...
|
||||
if (this._layoutManager.getType() == mindplot.layoutManagers.OriginalLayoutManager.NAME && nodeGraph.getTopicType()!=mindplot.NodeModel.CENTRAL_TOPIC_TYPE && children.length > 0)
|
||||
{
|
||||
var oldChildren = children;
|
||||
children = [];
|
||||
for (var i = 0; i < oldChildren.length; i++)
|
||||
{
|
||||
var child = oldChildren[i];
|
||||
var order = child.getOrder();
|
||||
if (order != null)
|
||||
{
|
||||
children[order] = child;
|
||||
} else
|
||||
{
|
||||
children.push(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < children.length; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
|
@ -34,8 +34,13 @@ mindplot.layoutManagers.BaseLayoutManager = new Class({
|
||||
},
|
||||
getDesigner:function(){
|
||||
return this._designer;
|
||||
},
|
||||
getType:function(){
|
||||
return mindplot.layoutManagers.BaseLayoutManager.NAME;
|
||||
}
|
||||
});
|
||||
|
||||
mindplot.layoutManagers.BaseLayoutManager.NAME ="BaseLayoutManager";
|
||||
|
||||
mindplot.layoutManagers.BaseLayoutManager.implement(new Events);
|
||||
mindplot.layoutManagers.BaseLayoutManager.implement(new Options);
|
@ -138,5 +138,10 @@ mindplot.layoutManagers.OriginalLayoutManager = mindplot.layoutManagers.BaseLayo
|
||||
_isCentralTopic:function(node){
|
||||
var type = node.getModel().getType();
|
||||
return type == mindplot.NodeModel.CENTRAL_TOPIC_TYPE;
|
||||
},
|
||||
getType:function(){
|
||||
return mindplot.layoutManagers.OriginalLayoutManager.NAME;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
mindplot.layoutManagers.OriginalLayoutManager.NAME ="OriginalLayoutManager";
|
Loading…
Reference in New Issue
Block a user