mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-24 18:58:11 +00:00
fix: modal node locate
This commit is contained in:
parent
2cedf733fb
commit
9a72dd7275
@ -826,10 +826,14 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
|||||||
event: e,
|
event: e,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (e.dragObject.nodes[0].getPrototype().isModal()) {
|
if (e.dragObject.type === 'node' && e.dragObject.nodes[0].getPrototype().isModal()) {
|
||||||
return this.designer.createLocation({
|
return this.designer.createLocation({
|
||||||
target: this.document.rootNode,
|
target: this.document.rootNode,
|
||||||
detail,
|
detail: {
|
||||||
|
type: LocationDetailType.Children,
|
||||||
|
index: 0,
|
||||||
|
valid: true,
|
||||||
|
},
|
||||||
source: 'simulator' + this.document.id,
|
source: 'simulator' + this.document.id,
|
||||||
event: e,
|
event: e,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -134,6 +134,20 @@ export class OutlineMain implements ISensor, ITreeBoard, IScrollable {
|
|||||||
const pos = getPosFromEvent(e, this._shell);
|
const pos = getPosFromEvent(e, this._shell);
|
||||||
const irect = this.getInsertionRect();
|
const irect = this.getInsertionRect();
|
||||||
const originLoc = document.dropLocation;
|
const originLoc = document.dropLocation;
|
||||||
|
|
||||||
|
if (e.dragObject.type === 'node' && e.dragObject.nodes[0].getPrototype().isModal()) {
|
||||||
|
return designer.createLocation({
|
||||||
|
target: document.rootNode,
|
||||||
|
detail: {
|
||||||
|
type: LocationDetailType.Children,
|
||||||
|
index: 0,
|
||||||
|
valid: true,
|
||||||
|
},
|
||||||
|
source: this.id,
|
||||||
|
event: e,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (originLoc && ((pos && pos === 'unchanged') || (irect && globalY >= irect.top && globalY <= irect.bottom))) {
|
if (originLoc && ((pos && pos === 'unchanged') || (irect && globalY >= irect.top && globalY <= irect.bottom))) {
|
||||||
const loc = originLoc.clone(e);
|
const loc = originLoc.clone(e);
|
||||||
const indented = this.indentTrack.getIndentParent(originLoc, loc);
|
const indented = this.indentTrack.getIndentParent(originLoc, loc);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user