- Remove visibility flag on createTopic.

This commit is contained in:
Paulo Gustavo Veiga 2012-09-27 09:17:34 -03:00
parent 4a0d70e3b3
commit f6e5018272
4 changed files with 7 additions and 12 deletions

View File

@ -556,7 +556,7 @@ mindplot.Designer = new Class({
for (var i = 0; i < branches.length; i++) { for (var i = 0; i < branches.length; i++) {
// NodeModel -> NodeGraph ... // NodeModel -> NodeGraph ...
var nodeModel = branches[i]; var nodeModel = branches[i];
var nodeGraph = this._nodeModelToNodeGraph(nodeModel, false); var nodeGraph = this._nodeModelToNodeGraph(nodeModel);
// Update shrink render state... // Update shrink render state...
nodeGraph.setBranchVisibility(true); nodeGraph.setBranchVisibility(true);
@ -594,7 +594,7 @@ mindplot.Designer = new Class({
return this._options.readOnly; return this._options.readOnly;
}, },
_nodeModelToNodeGraph:function (nodeModel, isVisible) { _nodeModelToNodeGraph:function (nodeModel) {
$assert(nodeModel, "Node model can not be null"); $assert(nodeModel, "Node model can not be null");
var children = nodeModel.getChildren().slice(); var children = nodeModel.getChildren().slice();
children = children.sort(function (a, b) { children = children.sort(function (a, b) {
@ -603,15 +603,11 @@ mindplot.Designer = new Class({
var nodeGraph = this._buildNodeGraph(nodeModel, this.isReadOnly()); var nodeGraph = this._buildNodeGraph(nodeModel, this.isReadOnly());
if (isVisible) {
nodeGraph.setVisibility(isVisible);
}
this._workspace.appendChild(nodeGraph); this._workspace.appendChild(nodeGraph);
for (var i = 0; i < children.length; i++) { for (var i = 0; i < children.length; i++) {
var child = children[i]; var child = children[i];
if ($defined(child)) if ($defined(child))
this._nodeModelToNodeGraph(child, false); this._nodeModelToNodeGraph(child);
} }
return nodeGraph; return nodeGraph;

View File

@ -259,9 +259,9 @@ mindplot.CommandContext = new Class({
this._designer._removeTopic(topic); this._designer._removeTopic(topic);
}, },
createTopic:function (model, isVisible) { createTopic:function (model) {
$assert(model, "model can not be null"); $assert(model, "model can not be null");
return this._designer._nodeModelToNodeGraph(model, isVisible); return this._designer._nodeModelToNodeGraph(model);
}, },
createModel:function () { createModel:function () {

View File

@ -32,7 +32,7 @@ mindplot.commands.AddTopicCommand = new Class({
this._models.each(function (model, index) { this._models.each(function (model, index) {
// Add a new topic ... // Add a new topic ...
var topic = commandContext.createTopic(model, false); var topic = commandContext.createTopic(model);
// Connect to topic ... // Connect to topic ...
if (this._parentsIds) { if (this._parentsIds) {

View File

@ -81,8 +81,7 @@ mindplot.commands.DeleteCommand = new Class({
}, this); }, this);
// Do they need to be connected ? // Do they need to be connected ?
this._deletedTopicModels.each(function (model, index) { this._deletedTopicModels.each(function (topicModel, index) {
var topicModel = this._deletedTopicModels[index];
var topics = commandContext.findTopics(topicModel.getId()); var topics = commandContext.findTopics(topicModel.getId());
var parentId = this._parentTopicIds[index]; var parentId = this._parentTopicIds[index];