mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 23:54:55 +01:00
Fix console error log
This commit is contained in:
parent
a8a601f351
commit
5b74b9cff3
@ -192,11 +192,9 @@ class Designer extends Events {
|
|||||||
const dragManager = new DragManager(workspace, this._eventBussDispatcher);
|
const dragManager = new DragManager(workspace, this._eventBussDispatcher);
|
||||||
const topics = designerModel.getTopics();
|
const topics = designerModel.getTopics();
|
||||||
|
|
||||||
|
// Enable all mouse events.
|
||||||
dragManager.addEvent('startdragging', () => {
|
dragManager.addEvent('startdragging', () => {
|
||||||
// Enable all mouse events.
|
topics.forEach((topic) => topic.setMouseEventsEnabled(false));
|
||||||
for (let i = 0; i < topics.length; i++) {
|
|
||||||
topics[i].setMouseEventsEnabled(false);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
dragManager.addEvent('dragging', (event, dragTopic) => {
|
dragManager.addEvent('dragging', (event, dragTopic) => {
|
||||||
@ -212,9 +210,7 @@ class Designer extends Events {
|
|||||||
});
|
});
|
||||||
|
|
||||||
dragManager.addEvent('enddragging', (event, dragTopic) => {
|
dragManager.addEvent('enddragging', (event, dragTopic) => {
|
||||||
for (let i = 0; i < topics.length; i++) {
|
topics.forEach((topic) => topic.setMouseEventsEnabled(true));
|
||||||
topics[i].setMouseEventsEnabled(true);
|
|
||||||
}
|
|
||||||
dragTopic.applyChanges(workspace);
|
dragTopic.applyChanges(workspace);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -308,9 +304,7 @@ class Designer extends Events {
|
|||||||
onObjectFocusEvent(currentObject, event) {
|
onObjectFocusEvent(currentObject, event) {
|
||||||
// Close node editors ..
|
// Close node editors ..
|
||||||
const topics = this.getModel().getTopics();
|
const topics = this.getModel().getTopics();
|
||||||
topics.forEach((topic) => {
|
topics.forEach((topic) => topic.closeEditors());
|
||||||
topic.closeEditors();
|
|
||||||
});
|
|
||||||
|
|
||||||
const model = this.getModel();
|
const model = this.getModel();
|
||||||
const objects = model.getEntities();
|
const objects = model.getEntities();
|
||||||
@ -666,19 +660,14 @@ class Designer extends Events {
|
|||||||
|
|
||||||
// Building node graph ...
|
// Building node graph ...
|
||||||
const branches = mindmapModel.getBranches();
|
const branches = mindmapModel.getBranches();
|
||||||
for (let i = 0; i < branches.length; i++) {
|
branches.forEach((branch) => {
|
||||||
// NodeModel -> NodeGraph ...
|
const nodeGraph = this.nodeModelToNodeGraph(branch);
|
||||||
const nodeModel = branches[i];
|
|
||||||
const nodeGraph = this.nodeModelToNodeGraph(nodeModel);
|
|
||||||
|
|
||||||
// Update shrink render state...
|
|
||||||
nodeGraph.setBranchVisibility(true);
|
nodeGraph.setBranchVisibility(true);
|
||||||
}
|
});
|
||||||
|
|
||||||
|
// Connect relationships ...
|
||||||
const relationships = mindmapModel.getRelationships();
|
const relationships = mindmapModel.getRelationships();
|
||||||
for (let j = 0; j < relationships.length; j++) {
|
relationships.forEach((relationship) => this._relationshipModelToRelationship(relationship));
|
||||||
this._relationshipModelToRelationship(relationships[j]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Place the focus on the Central Topic
|
// Place the focus on the Central Topic
|
||||||
const centralTopic = this.getModel().getCentralTopic();
|
const centralTopic = this.getModel().getCentralTopic();
|
||||||
@ -720,16 +709,16 @@ class Designer extends Events {
|
|||||||
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());
|
||||||
|
|
||||||
const nodeGraph = this._buildNodeGraph(nodeModel, this.isReadOnly());
|
const result = this._buildNodeGraph(nodeModel, this.isReadOnly());
|
||||||
nodeGraph.setVisibility(false);
|
result.setVisibility(false);
|
||||||
|
|
||||||
this._workspace.append(nodeGraph);
|
this._workspace.append(result);
|
||||||
for (let i = 0; i < children.length; i++) {
|
children.forEach((child) => {
|
||||||
const child = children[i];
|
if ($defined(child)) {
|
||||||
if ($defined(child)) this.nodeModelToNodeGraph(child);
|
this.nodeModelToNodeGraph(child);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
return nodeGraph;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user