Revert Desginer changes.

This commit is contained in:
Paulo Gustavo Veiga 2022-01-10 11:50:54 -08:00
parent 041adbc142
commit e1db8e7b47
3 changed files with 6 additions and 13 deletions

View File

@ -53,7 +53,7 @@ class CommandContext {
/** */ /** */
createTopic(model) { createTopic(model) {
$assert(model, 'model can not be null'); $assert(model, 'model can not be null');
return this._designer.nodeModelToNodeGraph(model); return this._designer.nodeModelToTopic(model);
} }
/** */ /** */

View File

@ -408,8 +408,7 @@ class Designer extends Events {
return this._model; return this._model;
} }
/** create a NodeModel for the selected node's child and add it via the ActionDispatcher */ createChildForSelectedNode(): void {
private _createChildForSelectedNode(): void {
const nodes = this.getModel().filterSelectedTopics(); const nodes = this.getModel().filterSelectedTopics();
if (nodes.length <= 0) { if (nodes.length <= 0) {
// If there are more than one node selected, // If there are more than one node selected,
@ -512,7 +511,7 @@ class Designer extends Events {
if (!topic.getOutgoingConnectedTopic()) { if (!topic.getOutgoingConnectedTopic()) {
// Central topic and isolated topics .... // Central topic and isolated topics ....
// Central topic doesn't have siblings ... // Central topic doesn't have siblings ...
this._createChildForSelectedNode(); this.createChildForSelectedNode();
} else { } else {
const parentTopic = topic.getOutgoingConnectedTopic(); const parentTopic = topic.getOutgoingConnectedTopic();
const siblingModel = this._createSiblingModel(topic); const siblingModel = this._createSiblingModel(topic);
@ -593,7 +592,7 @@ class Designer extends Events {
// Building node graph ... // Building node graph ...
const branches = mindmap.getBranches(); const branches = mindmap.getBranches();
branches.forEach((branch) => { branches.forEach((branch) => {
const nodeGraph = this._nodeModelToTopic(branch); const nodeGraph = this.nodeModelToTopic(branch);
nodeGraph.setBranchVisibility(true); nodeGraph.setBranchVisibility(true);
}); });
@ -628,7 +627,7 @@ class Designer extends Events {
return this._options.readOnly; return this._options.readOnly;
} }
private _nodeModelToTopic(nodeModel: NodeModel):Topic { nodeModelToTopic(nodeModel: NodeModel):Topic {
$assert(nodeModel, 'Node model can not be null'); $assert(nodeModel, 'Node model can not be null');
let children = nodeModel.getChildren().slice(); let children = nodeModel.getChildren().slice();
children = children.sort((a, b) => a.getOrder() - b.getOrder()); children = children.sort((a, b) => a.getOrder() - b.getOrder());
@ -639,7 +638,7 @@ class Designer extends Events {
this._workspace.append(result); this._workspace.append(result);
children.forEach((child) => { children.forEach((child) => {
if ($defined(child)) { if ($defined(child)) {
this._nodeModelToTopic(child); this.nodeModelToTopic(child);
} }
}); });
return result; return result;

View File

@ -30,12 +30,6 @@ div#mindplot {
background-size: 50px 50px; background-size: 50px 50px;
} }
div#small_error_icon {
padding-left: 18px;
min-height: 16px;
background: url(../images/error_icon.png) bottom left no-repeat !important;
}
.notesTip { .notesTip {
background-color: #dfcf3c; background-color: #dfcf3c;
padding: 5px 15px; padding: 5px 15px;