consistent Alt-key behavior
This commit is contained in:
@@ -488,12 +488,16 @@ export class CmapInteractionController {
|
|||||||
if (!target) {
|
if (!target) {
|
||||||
this.editor.ensureCanvasExtent(point.x, point.y);
|
this.editor.ensureCanvasExtent(point.x, point.y);
|
||||||
const parentSubmap = this.editor.submapAtPoint(point);
|
const parentSubmap = this.editor.submapAtPoint(point);
|
||||||
|
const direct = event.altKey || upEvent.altKey;
|
||||||
debug("relation dropped on empty canvas", {
|
debug("relation dropped on empty canvas", {
|
||||||
sourceId: source.id,
|
sourceId: source.id,
|
||||||
point,
|
point,
|
||||||
parentSubmapId: parentSubmap ? parentSubmap.id : null
|
parentSubmapId: parentSubmap ? parentSubmap.id : null,
|
||||||
|
direct
|
||||||
});
|
});
|
||||||
if (this.editor.onCreateConnectedItem) this.editor.onCreateConnectedItem({ source, point, parentSubmap });
|
if (this.editor.onCreateConnectedItem) {
|
||||||
|
this.editor.onCreateConnectedItem({ source, point, parentSubmap, direct });
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (target === source) return;
|
if (target === source) return;
|
||||||
|
|||||||
@@ -99,8 +99,9 @@ export class CmapConceptController {
|
|||||||
changes.submapDepth = createContext.parentSubmap.submapDepth + 1;
|
changes.submapDepth = createContext.parentSubmap.submapDepth + 1;
|
||||||
}
|
}
|
||||||
const newRecord = this.addNode(changes);
|
const newRecord = this.addNode(changes);
|
||||||
if (createContext.source && newRecord) editor.finishRelation(createContext.source, newRecord);
|
if (createContext.source && newRecord) {
|
||||||
else if (newRecord) editor.selectItem(newRecord);
|
editor.finishRelation(createContext.source, newRecord, Boolean(createContext.direct));
|
||||||
|
} else if (newRecord) editor.selectItem(newRecord);
|
||||||
}
|
}
|
||||||
editor.commitHistory();
|
editor.commitHistory();
|
||||||
if (this.getCurrentStorageMap()) await this.save({ automatic: true });
|
if (this.getCurrentStorageMap()) await this.save({ automatic: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user