Visual Studio Refactor: label improvement
Former-commit-id: 9fdc162ea454bc09bf08beb3d1ecf5deb775c99c
This commit is contained in:
parent
56fef21bc6
commit
8548b82bb4
|
@ -208,21 +208,6 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
||||||
row.append(cell);
|
row.append(cell);
|
||||||
table.append(emptyRow1, row, emptyRow2);
|
table.append(emptyRow1, row, emptyRow2);
|
||||||
|
|
||||||
switch (this.props.labelPosition) {
|
|
||||||
case "up":
|
|
||||||
case "down":
|
|
||||||
if (this.props.width > 0) {
|
|
||||||
table.style.width = `${this.props.width}px`;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "left":
|
|
||||||
case "right":
|
|
||||||
if (this.props.height > 0) {
|
|
||||||
table.style.height = `${this.props.height}px`;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// element.innerHTML = this.props.label;
|
// element.innerHTML = this.props.label;
|
||||||
element.append(table);
|
element.append(table);
|
||||||
}
|
}
|
||||||
|
@ -370,6 +355,28 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
||||||
this.elementRef.style.flexDirection = "column";
|
this.elementRef.style.flexDirection = "column";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ugly table to show the label as its legacy counterpart.
|
||||||
|
const tables = this.labelElementRef.getElementsByTagName("table");
|
||||||
|
const table = tables.length > 0 ? tables.item(0) : null;
|
||||||
|
if (table) {
|
||||||
|
switch (this.props.labelPosition) {
|
||||||
|
case "up":
|
||||||
|
case "down":
|
||||||
|
if (this.props.width > 0) {
|
||||||
|
table.style.width = `${this.props.width}px`;
|
||||||
|
table.style.height = null;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "left":
|
||||||
|
case "right":
|
||||||
|
if (this.props.height > 0) {
|
||||||
|
table.style.width = null;
|
||||||
|
table.style.height = `${this.props.height}px`;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue