Fixed audit log and event content dialogs sizing
This commit is contained in:
parent
392d2290cd
commit
eee4afb599
@ -105,14 +105,14 @@ export class AuditLogDetailsDialogComponent extends DialogComponent<AuditLogDeta
|
|||||||
let newWidth = 600;
|
let newWidth = 600;
|
||||||
if (content && content.length > 0) {
|
if (content && content.length > 0) {
|
||||||
const lines = content.split('\n');
|
const lines = content.split('\n');
|
||||||
newHeight = 16 * lines.length + 16;
|
newHeight = 17 * lines.length + 16;
|
||||||
let maxLineLength = 0;
|
let maxLineLength = 0;
|
||||||
lines.forEach((row) => {
|
lines.forEach((row) => {
|
||||||
const line = row.replace(/\t/g, ' ').replace(/\n/g, '');
|
const line = row.replace(/\t/g, ' ').replace(/\n/g, '');
|
||||||
const lineLength = line.length;
|
const lineLength = line.length;
|
||||||
maxLineLength = Math.max(maxLineLength, lineLength);
|
maxLineLength = Math.max(maxLineLength, lineLength);
|
||||||
});
|
});
|
||||||
newWidth = 8 * maxLineLength + 16;
|
newWidth = 9 * maxLineLength + 16;
|
||||||
}
|
}
|
||||||
// newHeight = Math.min(400, newHeight);
|
// newHeight = Math.min(400, newHeight);
|
||||||
this.renderer.setStyle(editorElement, 'minHeight', newHeight.toString() + 'px');
|
this.renderer.setStyle(editorElement, 'minHeight', newHeight.toString() + 'px');
|
||||||
|
|||||||
@ -139,14 +139,14 @@ export class EventContentDialogComponent extends DialogComponent<EventContentDia
|
|||||||
let newWidth = 600;
|
let newWidth = 600;
|
||||||
if (content && content.length > 0) {
|
if (content && content.length > 0) {
|
||||||
const lines = content.split('\n');
|
const lines = content.split('\n');
|
||||||
newHeight = 16 * lines.length + 16;
|
newHeight = 17 * lines.length + 16;
|
||||||
let maxLineLength = 0;
|
let maxLineLength = 0;
|
||||||
lines.forEach((row) => {
|
lines.forEach((row) => {
|
||||||
const line = row.replace(/\t/g, ' ').replace(/\n/g, '');
|
const line = row.replace(/\t/g, ' ').replace(/\n/g, '');
|
||||||
const lineLength = line.length;
|
const lineLength = line.length;
|
||||||
maxLineLength = Math.max(maxLineLength, lineLength);
|
maxLineLength = Math.max(maxLineLength, lineLength);
|
||||||
});
|
});
|
||||||
newWidth = 8 * maxLineLength + 16;
|
newWidth = 9 * maxLineLength + 16;
|
||||||
}
|
}
|
||||||
// newHeight = Math.min(400, newHeight);
|
// newHeight = Math.min(400, newHeight);
|
||||||
this.renderer.setStyle(editorElement, 'minHeight', newHeight.toString() + 'px');
|
this.renderer.setStyle(editorElement, 'minHeight', newHeight.toString() + 'px');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user