Merge branch 'ent-4258-visual-console-movement-redimension-mode' of https://brutus.artica.lan:8081/artica/pandorafms into ent-4258-visual-console-movement-redimension-mode

This commit is contained in:
Daniel Maya 2019-06-24 18:52:58 +02:00
commit 52f762bd5a
7 changed files with 50 additions and 24 deletions

View File

@ -113,4 +113,5 @@
animation: rotate-second 60s infinite linear;
}
/*# sourceMappingURL=vc.main.css.map*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -508,6 +508,15 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
* @param newProps
*/
public set meta(newMetadata: ItemMeta) {
this.setMeta(newMetadata);
}
/**
* Clasic and protected version of the setter of the `meta` property.
* Useful to override it from children classes.
* @param newProps
*/
protected setMeta(newMetadata: ItemMeta) {
const prevMetadata = this._metadata;
// Update the internal meta.
this._metadata = newMetadata;

View File

@ -53,6 +53,10 @@ export default class ColorCloud extends Item<ColorCloudProps> {
return container;
}
protected resizeElement(width: number): void {
super.resizeElement(width, width);
}
public createSvgElement(): SVGSVGElement {
const gradientId = `grad_${this.props.id}`;
// SVG container.

View File

@ -83,10 +83,26 @@ export default class Line extends Item<LineProps> {
...props,
...Line.extractBoxSizeAndPosition(props)
},
meta
{
...meta,
editMode: false
}
);
}
/**
* Clasic and protected version of the setter of the `meta` property.
* Useful to override it from children classes.
* @param newProps
* @override Item.setMeta
*/
public setMeta(newMetadata: ItemMeta) {
super.setMeta({
...newMetadata,
editMode: false
});
}
/**
* @override
* To create the item's DOM representation.

View File

@ -652,10 +652,6 @@ export function addResizementListener(
if (width === lastWidth && height === lastHeight) return;
console.log(
width - lastWidth,
e.pageX - elementLeft + (lastWidth - mouseElementOffsetX)
);
if (
width < lastWidth &&
e.pageX > elementLeft + (lastWidth - mouseElementOffsetX)