mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
#9924 Fixed visual console links
This commit is contained in:
parent
1d61ef11e7
commit
6b9cd42a3f
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -821,16 +821,35 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||||||
prevProps: Props | null = null,
|
prevProps: Props | null = null,
|
||||||
prevMeta: ItemMeta | null = null
|
prevMeta: ItemMeta | null = null
|
||||||
): void {
|
): void {
|
||||||
|
if (
|
||||||
|
prevProps &&
|
||||||
|
(prevProps.type == ItemType.LINE_ITEM ||
|
||||||
|
prevProps.type == ItemType.NETWORK_LINK)
|
||||||
|
) {
|
||||||
|
this.updateDomElement(this.childElementRef);
|
||||||
|
}
|
||||||
// Move box.
|
// Move box.
|
||||||
if (!prevProps || this.positionChanged(prevProps, this.props)) {
|
if (!prevProps || this.positionChanged(prevProps, this.props)) {
|
||||||
this.moveElement(this.props.x, this.props.y);
|
this.moveElement(this.props.x, this.props.y);
|
||||||
|
if (
|
||||||
|
prevProps &&
|
||||||
|
prevProps.type != ItemType.LINE_ITEM &&
|
||||||
|
prevProps.type != ItemType.NETWORK_LINK
|
||||||
|
) {
|
||||||
this.updateDomElement(this.childElementRef);
|
this.updateDomElement(this.childElementRef);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Resize box.
|
// Resize box.
|
||||||
if (!prevProps || this.sizeChanged(prevProps, this.props)) {
|
if (!prevProps || this.sizeChanged(prevProps, this.props)) {
|
||||||
this.resizeElement(this.props.width, this.props.height);
|
this.resizeElement(this.props.width, this.props.height);
|
||||||
|
if (
|
||||||
|
prevProps &&
|
||||||
|
prevProps.type != ItemType.LINE_ITEM &&
|
||||||
|
prevProps.type != ItemType.NETWORK_LINK
|
||||||
|
) {
|
||||||
this.updateDomElement(this.childElementRef);
|
this.updateDomElement(this.childElementRef);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Change label.
|
// Change label.
|
||||||
const oldLabelHtml = this.labelElementRef.innerHTML;
|
const oldLabelHtml = this.labelElementRef.innerHTML;
|
||||||
const newLabelHtml = this.createLabelDomElement().innerHTML;
|
const newLabelHtml = this.createLabelDomElement().innerHTML;
|
||||||
|
@ -558,6 +558,20 @@ export default class VisualConsole {
|
|||||||
delete this.lineLinks[i];
|
delete this.lineLinks[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
(this.lineLinks[i][line].start != itemAtStart &&
|
||||||
|
this.lineLinks[i][line].end == itemAtEnd) ||
|
||||||
|
(this.lineLinks[i][line].start == itemAtStart &&
|
||||||
|
this.lineLinks[i][line].end != itemAtEnd)
|
||||||
|
) {
|
||||||
|
// Object not connected to a line.
|
||||||
|
delete this.lineLinks[i][line];
|
||||||
|
|
||||||
|
if (Object.keys(this.lineLinks[i]).length === 0) {
|
||||||
|
delete this.lineLinks[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user